Use VBA to display record with criteria
I wouldn't copy my data to a new worksheet.
I'd add another column and use a formula like:
=and(a2="apple",b2="one")
Then drag this formula down the column.
Then I could use data|filter|autofilter to show the just the True's.
If I really wanted to copy that data to another sheet, I'd still use the same
technique, but just copy the visible cells after applying the filter.
Learn-more wrote:
I know only a little about using VBA and now have a problem not sure how to
work it out. I need to display some records in a new sheet according to some
criteria,
Example in Sheet A
A B C D
1 Apple one Mon 1
2 Banana two Tue 2
3 Apple two Wed 5
4 Apple one Thu 6
Say I need to display in Sheet B the records that satisfy A=Apple and B=one
and also with a total for D
I know how to use ComboBox etc to crate the list but dont know how to make
the selection and move to a new sheet.
Can anyone tell me how or show me some web site that I can find some examples.
Thanks so much.
--
Dave Peterson
|