Microsoft 365 verrouillage case a cocher

gothc

XLDnaute Occasionnel
Bonjour le forum
je cherche une solution en vb pour verrouiller une case a cocher si valeur dans une cellule
merci de votre aide
 

gothc

XLDnaute Occasionnel
VB:
Private Sub CheckBox1_Click()
With Worksheets("Paramètres_Application")
   If ActiveSheet.ComboBox1.Value = "" Then
     If Not (ActiveSheet.CheckBox1) Then Exit Sub
            MsgBox ("Vous devez sélectionner votre Nom dans la Liste déroulante.")
            ActiveSheet.CheckBox1 = False
             Exit Sub
    End If
   ' Sheets("plan").CheckBox1.Value = Me.CheckBox1.Value
      .Range("r2") = -ActiveSheet.CheckBox1
      ActiveSheet.CheckBox1.Caption = .Range("s2")
      .Range("u2") = IIf(ActiveSheet.CheckBox1, Date, Empty)
End With
 ' nom 
 If CheckBox1.Value = True Then
  Worksheets("Paramètres_Application").Range("v2") = ComboBox1.Value
  Else
     Worksheets("Paramètres_Application").Range("v2") = ""
 End If
 If CheckBox1.Value = True Then
Worksheets("Paramètres_Application").Range("w2") = ComboBox2.Value
Else
     Worksheets("Paramètres_Application").Range("w2") = ""
 End If
  ' controle texbox
 If CheckBox1.Value = faste Then TextBox1.BackColor = RGB(128, 255, 0)
If CheckBox1.Value = True Then TextBox1.BackColor = RGB(255, 0, 0)
TextBox1.Enabled = False
 ' plan
  Worksheets("plan").CheckBox1.Value = CheckBox1.Value
 
 
End Sub
 

Discussions similaires

Statistiques des forums

Discussions
311 729
Messages
2 081 971
Membres
101 852
dernier inscrit
dthi16088