Hi,
I'm using Excel 2000.
I have a speadsheet which has a table of data 3 columns wide (CODE, DESCRIPTION, CATEGORY). What I want to do is have the user to use autofilter on the CATEGORY column, and then to use VBA to populate the items of a combobox using ONLY the visible values from the autofiltered list (columns CODE and DESCRIPTION to be used, with CODE being the bound column).
How do I obtain ONLY the visible values from a filtered list and feed these into a combobox? I have tried using a For Next loop to check each row in turn for its property .Visible and if this is TRUE then use AddItem, but can't seem to get the syntax right.
Can anybody post some sample code which would get me on the right track?
Many thanks,
Ade
I'm using Excel 2000.
I have a speadsheet which has a table of data 3 columns wide (CODE, DESCRIPTION, CATEGORY). What I want to do is have the user to use autofilter on the CATEGORY column, and then to use VBA to populate the items of a combobox using ONLY the visible values from the autofiltered list (columns CODE and DESCRIPTION to be used, with CODE being the bound column).
How do I obtain ONLY the visible values from a filtered list and feed these into a combobox? I have tried using a For Next loop to check each row in turn for its property .Visible and if this is TRUE then use AddItem, but can't seem to get the syntax right.
Can anybody post some sample code which would get me on the right track?
Many thanks,
Ade