1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72
| Private Sub Worksheet_SelectionChange(ByVal Target As Range)
For n = 3 To 50
'Point normal
If Cells(n, 4) < 162 And Cells(n, 4) > 0 Then
If Cells(n, 4) <> 81 And Cells(n, 4) <> 91 And Cells(n, 4) <> 71 Then
If Cells(n, 5) = 1 Then
If 162 - Cells(n, 4) = Cells(n, 8) Then
Cells(n, 8) = 162 - Cells(n, 4)
Cells(n, 4) = Cells(n, 4) + 20
End If
Else
Cells(n, 8) = 162 - Cells(n, 4)
End If
End If
End If
If Cells(n, 8) < 162 And Cells(n, 8) > 0 Then
If Cells(n, 8) <> 81 And Cells(n, 8) <> 91 And Cells(n, 8) <> 71 Then
If Cells(n, 9) = 1 Then
If 162 - Cells(n, 8) = Cells(n, 4) Then
Cells(n, 4) = 162 - Cells(n, 8)
Cells(n, 8) = Cells(n, 8) + 20
End If
ElseIf Cells(n, 9) = 0 And Cells(n, 5) = 0 Then
Cells(n, 4) = 162 - Cells(n, 8)
End If
End If
End If
If [H4] = 81 And [L1] <> 1 Then
[H4] = 0
[D4] = 81
[A1] = 81
[L1] = 1
ElseIf [D4] = 81 And [L1] <> 1 Then
[D4] = 0
[H4] = 81
[A1] = 81
[L1] = 1
End If
If [A1] = 81 And [D5] <> 0 And [H5] <> 0 Then
If [D5] < [H5] Then
[H5] = [H5] + [A1]
[A1] = 0
ElseIf [D5] > [H5] Then
[D5] = [D5] + [A1]
[A1] = 0
End If
End If
If [H5] = 81 And [L2] <> 1 Then
[H5] = 0
[D5] = 81
[A1] = 81
[L2] = 1
ElseIf [D5] = 81 And [L2] <> 1 Then
[D5] = 0
[H5] = 81
[A1] = 81
[L2] = 1
End If
If [A1] = 81 And [D6] <> 0 And [H6] <> 0 Then
If [D6] < [H6] Then
[H6] = [H6] + [A1]
[A1] = 0
ElseIf [D6] > [H6] Then
[D6] = [D6] + [A1]
[A1] = 0
End If
End If
Next
End Sub |
Partager