View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
Juan Pablo González Juan Pablo González is offline
external usenet poster
 
Posts: 226
Default How to enter a Range of TextBoxes?

If they're located in a Userform:

Dim i As Long
For i = 1 to 12
Me.Controls("TextBox" & i).Visible = False
Next i

--
Regards,

Juan Pablo González

"bg18461 " wrote in message
...
Here is my redundant code,

TextBox1.Visible = False
TextBox2.Visible = False
TextBox3.Visible = False
TextBox4.Visible = False
TextBox5.Visible = False
TextBox6.Visible = False
TextBox7.Visible = False
TextBox8.Visible = False
TextBox9.Visible = False
TextBox10.Visible = False
TextBox11.Visible = False
TextBox12.Visible = False

Is there a easier way to enter a range of textboxes like
(Textbox1:Textbox12).Visible = False. (This did not work).

P.S. - The textboxes are from the Control ToolBox.


---
Message posted from http://www.ExcelForum.com/