change attributes of numberous textboxes

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
 
T

Tom Ogilvy

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.
 
Top