J
Jeff Smith
I have an analysis spreadsheet that is essentially a database of test
results for the various products monitored. The number of products can vary
as new ones are introduced and the convention of determining product codes
are inconsistent. They are however always unique withing the product range
listing.
At this time I have an autofilter set up that displays products in a
drop-down filter list. Excel automatically detects and displays a list of
all the unique products in the drop-down list. I do the analyses one at a
time by progressively selecting from the top through to the bottom of the
list.
I have been trying to work out (for a long time) how to automate this
process so I can click a macro button and let a macro perform all of the
filtered sorts. I already have a macro that captures the (manually
selected) analysed data and drops it into a summary report.
I have recorded the macro and the code is:
Selection.AutoFilter Field:=3, Criteria1:="Unique_ProductID_A"
Selection.AutoFilter Field:=3, Criteria1:="Unique_ProductID_B"
Selection.AutoFilter Field:=3, Criteria1:="Unique_ProductID_C"
until....
Selection.AutoFilter Field:=3, Criteria1:="Unique_ProductID_ZZ"
Defined products are contained in Column E.
What I do not know how to do is to use VBA to determine or define the "top
of the list", select the next unique product (second in the list) and
progress until the last unique record (bottom of the list) is found.
This much desired task is beyond my VBA skills and it may be that some kind
person sees this as a straightforward "do until" routine and can offer some
advice, suggestions, guidelines or similar code used for a similar problem
in the past.
Thanks in anticipation.
regards
Jeff Smith
results for the various products monitored. The number of products can vary
as new ones are introduced and the convention of determining product codes
are inconsistent. They are however always unique withing the product range
listing.
At this time I have an autofilter set up that displays products in a
drop-down filter list. Excel automatically detects and displays a list of
all the unique products in the drop-down list. I do the analyses one at a
time by progressively selecting from the top through to the bottom of the
list.
I have been trying to work out (for a long time) how to automate this
process so I can click a macro button and let a macro perform all of the
filtered sorts. I already have a macro that captures the (manually
selected) analysed data and drops it into a summary report.
I have recorded the macro and the code is:
Selection.AutoFilter Field:=3, Criteria1:="Unique_ProductID_A"
Selection.AutoFilter Field:=3, Criteria1:="Unique_ProductID_B"
Selection.AutoFilter Field:=3, Criteria1:="Unique_ProductID_C"
until....
Selection.AutoFilter Field:=3, Criteria1:="Unique_ProductID_ZZ"
Defined products are contained in Column E.
What I do not know how to do is to use VBA to determine or define the "top
of the list", select the next unique product (second in the list) and
progress until the last unique record (bottom of the list) is found.
This much desired task is beyond my VBA skills and it may be that some kind
person sees this as a straightforward "do until" routine and can offer some
advice, suggestions, guidelines or similar code used for a similar problem
in the past.
Thanks in anticipation.
regards
Jeff Smith