change attributes of numberous textboxes

  • Thread starter Thread starter Shawn
  • Start date Start date
S

Shawn

To all

Was wondering if there was a way to change to properties (say visible) of
numerous textboxes at once.

I have tried a for loop with i and then textbox(i) or textbox (format (i))
and even name1= "textbox" + format (i) then name1.visible but nothing works!

Is there a way to change them all or do i have to type them all out?

AHGA

Shawn
 
for i = 1 to 10
userform1.Controls("Textbox" & i).Visible = False
Next

for a worksheet

for i = 1 to 10
activesheet.OleObjects("Textbox" & i).Visible = False
Next i

this assumes these are textboxes from the control toolbox toolbar with names
like Textbox1, Textbox2, up to Textbox10.
 
Tom

THKS!!! You saved me a whole lot of typing!!

Thanks again!

Shawn
 

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

Back
Top