Properties of Combo Box in Userform

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Hi,

I'm using a combo box in a userform and using "Add Data" in the VBA code to
populate the drop down options...so far so good. However I'm having
difficulty selecting the correct properites of the combo box, to prevent the
(human) user from selecting & editing the options in the drop down, when the
userform appears. Everything I try prevents the dropdown from actually,
well..dropping down.

Also, is it possible to disable or make invisible a button on a worksheet
when a condition arises (say a cell changes to a preset value). I can make
the button "grey out" or disappear on a UserForm, but I can't see how to do
it if it's on a worksheet. OK, I could set a condition in the code for it not
operate if pushed, but "greying out" would be neater.

Thanks...Chris
 
If you set the Style property of the combobox to
2-fmStyleDropDownList, the user can only select items from the
dropdown list; the user cannot enter other data in the combobox.

To "grey out" a button, set the Enabled property to False.


--
Cordially,
Chip Pearson
Microsoft MVP - Excel
Pearson Software Consulting, LLC
www.cpearson.com



message
news:[email protected]...
 
Thanks Chip on the first point...but not sure how to set the Enabled property
on a button that resides on a worksheet...can do this no probs if its on the
Userform

Chris
 
If you are using the command button from the Controls toolbox, it
has an Enabled property that you can set from code:

Sheet1.CommandButton1.Enabled = True


--
Cordially,
Chip Pearson
Microsoft MVP - Excel
Pearson Software Consulting, LLC
www.cpearson.com


message
 
Back
Top