Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default 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

  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Hiding Labels

Thanks it works.

Micki

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



  #6   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Hiding Labels

Glad to help.


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

Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Excel 2007 text labels in category axis - missing labels Boris Charts and Charting in Excel 3 December 5th 08 04:33 PM
How do i create labels so, could only move and type in labels only kloniki Excel Discussion (Misc queries) 1 April 12th 08 06:04 AM
Hiding a button when hiding rows fergusor Excel Discussion (Misc queries) 2 August 10th 06 02:31 PM
Hiding Rows Leaves Labels Blank Laura Excel Discussion (Misc queries) 3 March 24th 06 01:10 PM
Excel 2003 and Labels (NOT Address Labels) Los Excel Discussion (Misc queries) 2 May 4th 05 01:57 PM


All times are GMT +1. The time now is 04:17 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"