How to get max number of items in a slicer list box

dkcoop03 used Ask the Experts™
I've been given a workbook that has a few slicer controls (They look like slicer controls) on the first sheet.  I am not familiar with slicer.  They are both list boxes and the two lists I'm interested in are the state selection list and the county selection list.  When I select a state in the state list, it brings up all of the counties in that state in the county list.  Then I select a county and the screen updates with that county information.  I need to write a program that loops through all states and all counties.  The states and counties are listed on another worksheet and have sequential numbers associated with them.  So there are 50 possible states and any number of counties per state.  How can I get the maxiumum number of counties for that state so I can use that number in my loop?  When I right click the state control it tells me where the state values are coming from (Another worksheet -- Cell Link "E5").  Same with counties.  If I query the county value in the immediate window it only returns the value of the county.  I need to access the list of counties for that state so that I can loop through them.  Any ideas?
Watch Question

Do more with

Expert Office
EXPERT OFFICE® is a registered trademark of EXPERTS EXCHANGE®
Analyst Assistant
I've never heard of a slicer control.

I was going to suggest you might have meant slider controls but your further description involving list sounds more like listboxes or comboboxes.

If they are comboboxes/listboxes when you right click there should also be a property called Input Range.

The range there will be where the list you want will be - the Cel Link property is a cell on the worksheet where the value selected goes.

The Cell Link is probably on the same worksheet as the control, while the Input Range, with the list(s) you want, will probably be on another sheet.
Is this a one time event, or something that will need to be able to be done programically for future workbooks?

Do more with

Expert Office
Submit tech questions to Ask the Experts™ at any time to receive solutions, advice, and new ideas from leading industry professionals.

Start 7-Day Free Trial