Problème codification VBA
Bonjour,
J'ai tapé le code ci-dessous qui me permet, lorsque je clique dans une cellule, l'ouverture d'un formulaire. Lors du premier clic, il me demande un mot de passe. Mais dans l'état actuel, il me demande le mot de passe à chaque clic.
Pouvez-vous me dire où j'ai fait une erreur et si vous pouvez m'aider ?
Merci par avance
Code:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22
| Private Sub Worksheet_SelectionChange(ByVal Target As Range)
Dim Col As Long
Dim Lig As Long
Dim A As Long
Dim Vpasse As Long
Vpasse = Val(InputBox("Mot de passe ?"))
If Vpasse < 6100 Then Exit Sub
If Vpasse = 6100 Then
If Intersect(Range("ZO1"), ActiveCell) Is Nothing Then Exit Sub
If IsEmpty(ActiveCell.Value) Then
Lig = 6
Col = ActiveCell.Column
A = Cells(Lig, Col).Value
If A = 0 Then Col = Col - 1
If Weekday(Cells(Lig, Col).Value) <> 1 And Weekday(Cells(Lig, Col).Value) <> 7 Then
Load FrmAbs
FrmAbs.Show
End If
End If
End If
Exit Sub
End Sub |