I need to lookup rows from sheet 1 to construct a list in sheet 2 but I only want data from rows that match a certain criteria, and I do not want any empty rows:
Example: Criteria is "Type 3"
Sheet1:
A1 "CarA", B1 "Type 2"
A2 "CarB" B2 "Type 3"
A3 "LorryA" B3 "Type 3"
I would like this to produce the following in sheet 2:
A1 "CarB" B1 "Type 3"
A2 "Lorry" B2 "Type 3"
Anyone?
Thanks![]()
VBA isn't necessary, but it can surely be done that way.
Manual (and quick) method:
1) On sheet 1 click in the data and select DATA > FILTER > AUTOFILTER
2) Filter by the Type column for "Type 3" and all other rows will be hidden.
3) Copy all visible data enmasse to another sheet.
VBA
You could simply record yourself doing those steps above and have a workable macro, or at least the base code that's easy enough to tweak.
_________________
Microsoft MVP 2010 - Excel
Visit: Jerry Beaucaire's Excel Files & Macros
If you've been given good help, use theicon below to give reputation feedback, it is appreciated.
Always put your code between code tags. [CODE] your code here [/CODE]
“None of us is as good as all of us” - Ray Kroc
“Actually, I *am* a rocket scientist.” - JB (little ones count!)
There are currently 1 users browsing this thread. (0 members and 1 guests)
Bookmarks