Mitch Swetsky
asked on
Excel VBA to copy row where 2 cells meet criteria
I have 2 workbooks.
One is named "total parts" (has 1 sheet named Total Parts)
The other "PLGFP" (Has 3 sheets Sheet 1 ...)
I want to copy 2 types of data from the 'total parts' sheet which usually has a few thousand rows.
I need to look for any row in 'total parts' that has "OGM" in Col J and "YTD" in Col O and copy that row into Sheet 1 of PLGFP
Then
I need to look for any row in 'total parts' that has "TS CRU" in Col J and "YTD" in Col O and copy that row into Sheet 2 of PLGFP.
So I expect to have a few hundred rows in each Sheet 1 & 2 of book PLGFP, which I will save and then perform some calculations
This will be a monthly automated macro and the number of rows will vary.
One is named "total parts" (has 1 sheet named Total Parts)
The other "PLGFP" (Has 3 sheets Sheet 1 ...)
I want to copy 2 types of data from the 'total parts' sheet which usually has a few thousand rows.
I need to look for any row in 'total parts' that has "OGM" in Col J and "YTD" in Col O and copy that row into Sheet 1 of PLGFP
Then
I need to look for any row in 'total parts' that has "TS CRU" in Col J and "YTD" in Col O and copy that row into Sheet 2 of PLGFP.
So I expect to have a few hundred rows in each Sheet 1 & 2 of book PLGFP, which I will save and then perform some calculations
This will be a monthly automated macro and the number of rows will vary.
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
As I mentioned I was at a point in a large macro that I was able to include the needed part of your macro with some amendments. Thank you very much for the prompt reply.
ASKER