ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Checkbox List in VBA? (https://www.excelbanter.com/excel-programming/312607-checkbox-list-vba.html)

Freddie[_2_]

Checkbox List in VBA?
 
does Excel has CheckboxList object like the ones in normal VB?

i need to provide different number of checkboxes options based on
different cases. (E.g: case 1, i need to display 6 checkboxes, case 2
i need to display 11. both cases with different captions of course).
Of course i can do it in tedious way to create one individual checkbox
for each case, but i'm curious about it. It could save time and the
code will be neater as well:)

regards

freddie

Bob Phillips[_6_]

Checkbox List in VBA?
 
Excel does not have a control array like VB if that is what you mean.

Rather than build/destroy objects, you could always create the maximum, and
hide and show as required.

--

HTH

RP

"Freddie" wrote in message
om...
does Excel has CheckboxList object like the ones in normal VB?

i need to provide different number of checkboxes options based on
different cases. (E.g: case 1, i need to display 6 checkboxes, case 2
i need to display 11. both cases with different captions of course).
Of course i can do it in tedious way to create one individual checkbox
for each case, but i'm curious about it. It could save time and the
code will be neater as well:)

regards

freddie




Andy Pope

Checkbox List in VBA?
 
Hi,

Try setting these 2 properties on a listbox,

MultiSelect = 1 (SelectMulti) or 2 (SelectExtend)
ListStyle = 1 (ListstyleOption)

The use of multiselect will cause the normal optionbuttons to change to
checkbox buttons.

Cheers
Andy

Bob Phillips wrote:

Excel does not have a control array like VB if that is what you mean.

Rather than build/destroy objects, you could always create the maximum, and
hide and show as required.


--

Andy Pope, Microsoft MVP - Excel
http://www.andypope.info


All times are GMT +1. The time now is 08:53 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com