how to use a variable in this line

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 & ")
 
I

isabelle

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 :
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top