|
|
Private Sub CommandButton1_Click()
If [b3] = "" Then Exit Sub
k2 = Int(([b10] - 1) / 29)
k1 = [b10] - k2 * 29 + 1
k2 = (k2 + 1) * 2
Worksheets("车位").Cells(k1, k2).Value = [b3]
For i = 4 To 9
If Cells(i, 2).Value = "" Then
Exit Sub
ElseIf Cells(i, 2).Value = 1 Then '1#楼
I1 = 27 - Cells(i, 6).Value * 2
If Cells(i, 8).Value = "" Then
Exit Sub
ElseIf Cells(i, 8).Value = "西" Then
I2 = 10 - Cells(i, 4).Value * 2
ElseIf Cells(i, 8).Value = "东" Then
I2 = 11 - Cells(i, 4).Value * 2
End If
ElseIf Cells(i, 2).Value = 2 Then '2#楼
I1 = 53 - Cells(i, 6).Value * 2
If Cells(i, 8).Value = "" Then
Exit Sub
ElseIf Cells(i, 8).Value = "西" Then
I2 = 10 - Cells(i, 4).Value * 2
ElseIf Cells(i, 8).Value = "东" Then
I2 = 11 - Cells(i, 4).Value * 2
End If
ElseIf Cells(i, 2).Value = 3 Then '3#楼
I1 = 27 - Cells(i, 6).Value * 2
If Cells(i, 8).Value = "" Then
Exit Sub
ElseIf Cells(i, 8).Value = "西" Then
I2 = 19 - Cells(i, 4).Value * 2
ElseIf Cells(i, 8).Value = "东" Then
I2 = 20 - Cells(i, 4).Value * 2
End If
ElseIf Cells(i, 2).Value = 4 Then '4#楼
I1 = 27 - Cells(i, 6).Value * 2
If Cells(i, 8).Value = "" Then
Exit Sub
ElseIf Cells(i, 8).Value = "西" Then
I2 = 26 - Cells(i, 4).Value * 3
ElseIf Cells(i, 8).Value = "中" Then
I2 = 27 - Cells(i, 4).Value * 3
ElseIf Cells(i, 8).Value = "东" Then
I2 = 28 - Cells(i, 4).Value * 3
End If
End If
Worksheets("安置名单").Cells(I1, I2).Value = [b3]
Next
End Sub
安置表33.zip
(24.8 KB, 下载次数: 9)
|
|