Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
Hiding Labels
I'm using user forms to build a program and I want some radio button
hidden based on what the user selects on a previous form. I know yo can set the radio button's visible property to false or true on th form however I'm not sure how to change the visible property based o what a user selects on a different form. For example my userForm1 ask a user to select from different options in radio buttons, depending o the selection UserForm1 sends the user to UserForm2, but also dependin on the selection I only want certain options in radio buttons t display so a user can only select further options that directly pertai to the previous choices. I know I could use different forms for each selection but I think thi will make the program overly confusing and I would like to limit m total user forms by hiding inappropriate choices based on the previou choices. Thanks for any help! Micki -- Message posted from http://www.ExcelForum.com |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
Hiding Labels
Something like this in userform2:-
Code ------------------- Private Sub UserForm_Activate() Me.OptionButton1.Visible = _ IIf(UserForm1.TextBox1.Value = "", False, True) End Sub ------------------- To read a value from a userform it has to be live. So in userform1 an 2 you will use something like :- Code ------------------- Private Sub CommandButton1_Click() Me.Hide UserForm2.Show End Sub ------------------- -- Message posted from http://www.ExcelForum.com |
#3
Posted to microsoft.public.excel.programming
|
|||
|
|||
Hiding Labels
Could you break down this code for me and tell me what each part i
doing (mainly the False True part)? I'm trying to use an option box o UserForm1 and I'm not sure how to use what you have to accomplis that. Private Sub UserForm_Activate() Me.OptionButton1.Visible = _ IIf(UserForm1.TextBox1.Value = "", False, True) End Sub For instance I want to have the optionbutton on UserForm2 not visibl if the optionbutton on UserForm1 was selected. Thanks again, Micki -- Message posted from http://www.ExcelForum.com |
#4
Posted to microsoft.public.excel.programming
|
|||
|
|||
Hiding Labels
It is a shorthand version of this - which is what you want :-
Code ------------------- '- userform 2 code Private Sub UserForm_Activate() If UserForm1.OptionButton1.Value = True Then Me.OptionButton1.Visible = False Else Me.OptionButton1.Visible = True End If ------------------- -- Message posted from http://www.ExcelForum.com |
#6
Posted to microsoft.public.excel.programming
|
|||
|
|||
Hiding Labels
|
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Excel 2007 text labels in category axis - missing labels | Charts and Charting in Excel | |||
How do i create labels so, could only move and type in labels only | Excel Discussion (Misc queries) | |||
Hiding a button when hiding rows | Excel Discussion (Misc queries) | |||
Hiding Rows Leaves Labels Blank | Excel Discussion (Misc queries) | |||
Excel 2003 and Labels (NOT Address Labels) | Excel Discussion (Misc queries) |