|
|
|
|
Bonjour, je voudrais voir si des checkbox sont à vrai ou pas sur VBA pour excell. Mon gros problème est de faire boucler les checkbox il y en a une centaine.
Voilà mon code erroné
For i = 1 To 100
Dim a
If Feuil3.CheckBox"&i.Value = true Then
a = 1
End If
Next
ce qui marche c'est sans boucle:
If Feuil3.CheckBox1.Value = true Then
a = 1
End If
Merci de votre aide
Configuration: Windows XP Internet Explorer 6.0
Bonjour, il semble qu'il y ait un gros problème dans ta boucle, tu redefinis a chaque fois ta variable "a" et au final "a" ne te retourne true ou false que pour ta dernière checkbox
P4 2.4, 512 DDR,Geforce 6200 AGP Win XP SP2|||P3 1 GHZ , 256 SDRAM, Debian Etch ||| P3 1Ghz , 392 SDRAM , Xubuntu 6.10
|
Bonjour,
Private Sub CommandButton1_Click() Dim ctrl As control, nom As String For Each ctrl In Me.Controls nom = ctrl.Name If InStr(nom, "CheckBox") = 1 Then MsgBox nom & " = " & ctrl.Value End If Next |
Salut,
|