excel userform / vba

p4nny

Board Regular
Joined
Jan 13, 2015
Messages
246
Hi,

I would like certain controls to hide / display dependent on selected options in a combo box.

Please could you help?

For example

If "Birthday party" is selected in a combo box, then a further set of controls would appear asking questions such as name, age etc. If any other option is selected then hide the questions.

hope this is clear

many thanks
 

Excel Facts

Get help while writing formula
Click the italics "fx" icon to the left of the formula bar to open the Functions Arguments dialog. Help is displayed for each argument.
See if this gets you started:

Code:
If Me.cbo_PartyTyp.Value = "Birthday Party" Then
  Me.tb_Name.Visible = True
Else
 Me.tb_Name.Visible = False
End If

Although if you're going to be changing the visibility of a bunch of controls with lots of criteria you might want to consider showing different forms, or use a Multi-Page control. Or at least use a Select Case structure instead of If's, which will get pretty long winded and hard to read.

HTH,
 
Upvote 0
thats great! thanks.

also, I would like the userform to display a calendar allowing the user to select a date? Ideally time additionally.

Is this possible?

thanks again for the guidance
 
Upvote 0

Forum statistics

Threads
1,216,073
Messages
6,128,641
Members
449,461
Latest member
kokoanutt

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top