Userform questions !

awsumchillicrab

Board Regular
Joined
Jan 30, 2011
Messages
56
Hi,

I have a userform with some option buttons, a checkbox, labels, and some a "Run" command button. Here's what I want to do:

I want the "Run" button to be greyed out or somewhat unclickable unless the checkbox is checked and one of the option buttons selected.

When an option button is selected, I want the label to have different captions. At first, the label should be blank. If 1st button selected, it should be "ABC", and if 2nd selected, "DEF"...etc

And I can't seem to press enter in a labelbox (to get the cursor one line down in the same label box).

Any help appreciated!
 

Excel Facts

Select a hidden cell
Somehide hide payroll data in column G? Press F5. Type G1. Enter. Look in formula bar while you arrow down through G.
And I can't seem to press enter in a labelbox (to get the cursor one line down in the same label box).
Ctrl + Enter, not just Enter.

Regarding the rest, you'll have to use some event code, but it's involved. It may help if you can post the workbook with the userform populated with all the labels/buttons/optoin button etc. in the interweb somewhere (box.net?)
 
Last edited:
Upvote 0
Thanks! Got the ctrl enter

I managed to figure the rest using Events.
Curious though, is there a better way of doing it? For example, I have below:

Private Sub CheckBox1_Change()
If CheckBox1 = True And _
(OptionButton1 = True Or OptionButton2 = True Or _
OptionButton3 = True Or OptionButton4 = True) Then
CommandButton1.Locked = False
Else
CommandButton1.Locked = True
End If
End Sub

This code resides in an event of checkbox change, which is fine. But can I put this code in a more general space, without event triggers?
 
Upvote 0

Forum statistics

Threads
1,224,604
Messages
6,179,857
Members
452,948
Latest member
UsmanAli786

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