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 73 74
| Private Sub Worksheet_SelectionChange(ByVal Target As Range)
Application.EnableEvents = False
'==========================
'=====================Lot 1
'==========================
If Worksheets("Feuil1").Cells(1, 1).Value = 1 Then
MsgBox ("Selectionner le Lot 1. Select the Lot 1")
Range("a1").Select
Else
If Worksheets("Feuil1").Cells(2, 1).Value = 0 Then
MsgBox ("Entrer le T1 du Lot1. Enter the T1 of the Lot1")
Range("a2").Select
Else
'==========================
'=====================Lot 2
'==========================
If MsgBox("Un deuxieme Lot? A second Lot", vbYesNo + vbInformation, _
"Attention") = vbNo Then
Exit Sub
Else
If Worksheets("Feuil1").Cells(1, 2).Value = 1 Then
MsgBox ("Selectionner le Lot2. Select the Lot2")
Range("b1").Select
Else
If Worksheets("Feuil1").Cells(2, 2).Value = 0 Then
MsgBox ("Entrer le T2 du Lot2. Enter the T2 of the Lot2")
Range("b2").Select
Else
End If
Exit Sub
End If
End If
End If
End If
Application.EnableEvents = True
End Sub |
Partager