how to use a variable in this line

  • Thread starter Thread starter Jesper F
  • Start date Start date
J

Jesper F

This works
If Sheets("refdata").chkAll = True Then

but I want to cycle through many checkboxes.
How do I use a varialble for the checkboxname?

These dont work:
Sheets("refdata")(myvar)
Sheets("refdata").(myvar)
Sheets("refdata")(" & myvar & ")
Sheets("refdata").(" & myvar & ")
 
hi Jesper,

With Sheets("refdata")
For Each Sh In .Shapes
If TypeName(Sh.OLEFormat.Object.Object) = "CheckBox" Then
If Sh.OLEFormat.Object.Object.Value = True Then
MsgBox Sh.Name
End If
End If
Next
End With



--
isabelle



Le 2012-04-19 12:15, Jesper F a écrit :
 
Back
Top