Home |
Search |
Today's Posts |
|
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
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 lik (Textbox1:Textbox12).Visible = False. (This did not work). P.S. - The textboxes are from the Control ToolBox -- Message posted from http://www.ExcelForum.com |
#2
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
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/ |
#3
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
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/ |
#4
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Thanks for everyone's responses so far, I do appreciate it, now back t
the code. Below shows the code and the error as I have it in my program, an hints... Private Sub OptionButton1_Click() Dim i As Long For i = 23 To 190 Worksheets("Sheet4").OLEObjects("Label" & i).Visible = False Next i ERROR: Run-time error '9': Subscript out of rang -- Message posted from http://www.ExcelForum.com |
#5
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
That would suggest that Sheet4 doesn't exits, or one of the Texboxes 23 to
190 doesn't exist. When it occurs, get the error in debug. -- HTH Bob Phillips ... looking out across Poole Harbour to the Purbecks (remove nothere from the email address if mailing direct) "bg18461 " wrote in message ... Thanks for everyone's responses so far, I do appreciate it, now back to the code. Below shows the code and the error as I have it in my program, any hints... Private Sub OptionButton1_Click() Dim i As Long For i = 23 To 190 Worksheets("Sheet4").OLEObjects("Label" & i).Visible = False Next i ERROR: Run-time error '9': Subscript out of range --- Message posted from http://www.ExcelForum.com/ |
#6
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Ok, I got rid of error 9 (subscript out of range) - wrong sheet name
however this error has been surplanted by 'Run-time error 438' - Objec doesn't support this property or method. Here is my code: Dim i As Long For i = 16 To 31 Worksheets("INSRD VEH PASS").OLEObjects("OptionButton" & i).BackColor &HFFFF& Next i It appears to not like the OLEObjects method, but I cannot figure out way around this. Any suggestions.. -- Message posted from http://www.ExcelForum.com |
#7
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
In article , bg18461
says... Thanks for everyone's responses so far, I do appreciate it, now back to the code. Below shows the code and the error as I have it in my program, any hints... Private Sub OptionButton1_Click() Dim i As Long For i = 23 To 190 Worksheets("Sheet4").OLEObjects("Label" & i).Visible = False Next i ERROR: Run-time error '9': Subscript out of range Weren't you working with Textboxes, not Labels? If there are fewer labels then textboxes then you'll get that error. See ya Ken McLennan Qld Australia |
#8
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
You are the man! Thanks for your help, it worked :)
-- Message posted from http://www.ExcelForum.com |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
How do I enter formula sum(range+range)*0.15 sumif(range=3) | Excel Discussion (Misc queries) | |||
Enter Range | New Users to Excel | |||
How do you enter input range for a histogram | Excel Discussion (Misc queries) | |||
How do you enter input range for a histogram | Excel Discussion (Misc queries) | |||
User must enter something in a range of cells | Excel Discussion (Misc queries) |