Referencing Object Names with Variable

J

jbl25

Hello,
I'm trying to loop through objects (CheckBox controls) on a worksheet
using a variable in the name. Based on the syntax for UserForm
controls, I'm trying

For x = 1 to 10
Worksheets("Sheet1").Controls("CheckBox" & x).Visible = True
Worksheets("Sheet1").Controls("CheckBox" & x).Enabled= True
Next

This gives me Run-time Error 438 "Object doesn't support this property
or method.

Thanks for your help!
 

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