ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   VBA: Creating listbox similar to the one in Pivot table (Listbox+Checkbox) (https://www.excelbanter.com/excel-programming/337538-vba-creating-listbox-similar-one-pivot-table-listbox-checkbox.html)

modjoe23

VBA: Creating listbox similar to the one in Pivot table (Listbox+Checkbox)
 

Hi,

I would like to create a listbox that looks and functions exactly like
the ones in the Pivot tables where by default all are selected or user
can choose as many as they want. Is there a control for me to do this
(listbox + checkbox) or should I use a regular listbox?

Thanks,
Joe


--
modjoe23
------------------------------------------------------------------------
modjoe23's Profile: http://www.excelforum.com/member.php...o&userid=26376
View this thread: http://www.excelforum.com/showthread...hreadid=396510


summer

VBA: Creating listbox similar to the one in Pivot table (Listbox+C
 
ModJoe:

If I understood you correctly, what you want to do is 'Auto
Filter', which is a very simple task. Here's what you'll need to do:

If your spreadsheet is organized as a list, simply click a cell in list. /
If not, highlight a single cell or row containing your column headers.

Next, on the standard toolbar, click 'Data' - 'Filter' - 'Autofilter'...and
you're done! You'll notice each of your column headers now has a 'list box'
look with all entires selected by default. The list may be sorted by blank,
non-blank, custom, top 10, or any one or all of the entries.

If at any time you decide you want to turn off the Auto Filter, simply click
'Data' - 'Filter' - 'Auto Filter' to remove the check mark.

I hope this is what you're looking for. Much simpler than adding controls.
Let me know if you have questions. :)

"modjoe23" wrote:


Hi,

I would like to create a listbox that looks and functions exactly like
the ones in the Pivot tables where by default all are selected or user
can choose as many as they want. Is there a control for me to do this
(listbox + checkbox) or should I use a regular listbox?

Thanks,
Joe


--
modjoe23
------------------------------------------------------------------------
modjoe23's Profile: http://www.excelforum.com/member.php...o&userid=26376
View this thread: http://www.excelforum.com/showthread...hreadid=396510



Stephen Bullen[_4_]

VBA: Creating listbox similar to the one in Pivot table (Listbox+Checkbox)
 
Hi Modjoe23,

Just use a regular list box, with MultiSelect set to true. There is a
property to make it show check boxes, but I've never been impressed by
it.

Regards

Stephen Bullen
Microsoft MVP - Excel

Professional Excel Development
The most advanced Excel VBA book available
www.oaltd.co.uk/ProExcelDev



modjoe23[_2_]

VBA: Creating listbox similar to the one in Pivot table (Listbox+Checkbox)
 

I wasn't aware that it was that simple, sorry and thanks


--
modjoe23
------------------------------------------------------------------------
modjoe23's Profile: http://www.excelforum.com/member.php...o&userid=26376
View this thread: http://www.excelforum.com/showthread...hreadid=396510



All times are GMT +1. The time now is 04:38 AM.

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