PDA

View Full Version : List Box



dmg7502
12-08-2005, 09:56 AM
I am trying to add an active x list box to my spreadsheet. I have added the box, but I can't figure out how to add the text that I want to appear in the list. I want to be able to select yes or no from the drop down.

Bob Phillips
12-08-2005, 10:05 AM
I am trying to add an active x list box to my spreadsheet. I have added the box, but I can't figure out how to add the text that I want to appear in the list. I want to be able to select yes or no from the drop down.

You can set the ListFillRange property to cells on the worksheet, or use code like


With Activesheet.Listbox1
.AddItem "Yes"
.AddItem "No"
End With


But with just two options why not use a checkbox?

Zack Barresse
12-08-2005, 10:18 AM
Or you could use Data | Validation (List), for an in-cell drop down box.

matthewspatrick
12-08-2005, 10:25 AM
One simple way: enter Yes and No in a range, and then use that range to define the controls ListFillRange property.

matthewspatrick
12-08-2005, 10:27 AM
Or you could use Data | Validation (List), for an in-cell drop down box.

Overall, I use this approach probably 90% of the time. It's probably just me, but I do not like using ActiveX controls on worksheets:dunno

Zack Barresse
12-08-2005, 10:32 AM
You're not alone there Patrick!

Bob Phillips
12-08-2005, 11:19 AM
You're not alone there Patrick!

Why? They are the only flexible worksheet controls.

Zack Barresse
12-08-2005, 11:24 AM
I find them cumbersome, overtly expensive in terms of spreadsheet design and elegance, difficult for users to create/use, don't work on Mac solutions, and I think (generally and usually) the process can be performed on the worksheet more effectively without the controls. Not to mention the past bugs they have had (there are still a lot of older versions without updates out there).

matthewspatrick
12-08-2005, 11:24 AM
Why? They are the only flexible worksheet controls.

Allow me to clarify--I do not like any worksheet controls. :)

If I need controls, I'd rather use a UserForm, which has much, much, much greater flexibility.