View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
Bob Phillips[_6_] Bob Phillips[_6_] is offline
external usenet poster
 
Posts: 11,272
Default How to enter a Range of TextBoxes?

But as they are control tolbox textboxes use

Dim i As Long
For i = 1 To 12
Worksheets("Sheet1").OLEObjects("TextBox" & i).Visible = False
Next i


--

HTH

Bob Phillips
... looking out across Poole Harbour to the Purbecks
(remove nothere from the email address if mailing direct)

"Juan Pablo Gonzalez" wrote in message
...
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/