titepestounette
XLDnaute Nouveau
Bonjour,
Voila, je débute en vba je cherche comment faire ceci, en espérant être assez clai.
si checkbox1=vrai checkbox1 caption = A1
si checkbox1 = faux mais check box2 = vrai checkbox2 caption = A1
si checkbox1 = vrai et que checkbox2 = vrai checkbox1 caption en A1 et checkbox 2 caption en B2 c'est la que je ???? et je continue comme ca avec 20 checkbox
voici un bout de code, Merci au bon samaritain qui vas pouvoir m'éclairer
Titepestounette
Private Sub CommandButton1_Click()
Dim str As Variant
If CheckBox1 = True Then
str = CheckBox1.Caption
Range("A1").Value = str
End If
If CheckBox2 = True Then
str = CheckBox2.Caption
Range("B1").Value = str
End If
If CheckBox1 = False Then
str = CheckBox2.Caption
Range("A1").Value = str
End If
If CheckBox2 = False Then
str = CheckBox3.Caption
range("A1").Value = str
End If
End Sub
Voila, je débute en vba je cherche comment faire ceci, en espérant être assez clai.
si checkbox1=vrai checkbox1 caption = A1
si checkbox1 = faux mais check box2 = vrai checkbox2 caption = A1
si checkbox1 = vrai et que checkbox2 = vrai checkbox1 caption en A1 et checkbox 2 caption en B2 c'est la que je ???? et je continue comme ca avec 20 checkbox
voici un bout de code, Merci au bon samaritain qui vas pouvoir m'éclairer
Titepestounette
Private Sub CommandButton1_Click()
Dim str As Variant
If CheckBox1 = True Then
str = CheckBox1.Caption
Range("A1").Value = str
End If
If CheckBox2 = True Then
str = CheckBox2.Caption
Range("B1").Value = str
End If
If CheckBox1 = False Then
str = CheckBox2.Caption
Range("A1").Value = str
End If
If CheckBox2 = False Then
str = CheckBox3.Caption
range("A1").Value = str
End If
End Sub