Conditional Pull from Multiple Worksheets

tomwac

New Member
Joined
Mar 4, 2011
Messages
3
I am trying to pull rows from multiple worksheets to a summary worksheet if the column "I" is equal to "Fail". Does anyone have a macro for conditional pull like this. Thank you very much.
 

Excel Facts

Save Often
If you start asking yourself if now is a good time to save your Excel workbook, the answer is Yes

Smitty

Legend
Joined
May 15, 2003
Messages
29,536
Welcome to the Board!

This assumes that you have data in column A:

<font face=Calibri><SPAN style="color:#00007F">Sub</SPAN> foo()<br>    <SPAN style="color:#00007F">Dim</SPAN> i <SPAN style="color:#00007F">As</SPAN> <SPAN style="color:#00007F">Long</SPAN><br>    <SPAN style="color:#00007F">Dim</SPAN> ws <SPAN style="color:#00007F">As</SPAN> Worksheet<br>        <SPAN style="color:#00007F">For</SPAN> <SPAN style="color:#00007F">Each</SPAN> ws <SPAN style="color:#00007F">In</SPAN> ActiveWorkbook.Worksheets<br>            <SPAN style="color:#00007F">For</SPAN> i = 2 <SPAN style="color:#00007F">To</SPAN> ws.Cells(Rows.Count, "I").End(xlUp).Row<br>                <SPAN style="color:#00007F">If</SPAN> ws.Cells(i, "I").Value = "Fail" <SPAN style="color:#00007F">Then</SPAN> ws.Cells(i, "I").EntireRow.Copy Sheets("Summary").Cells(Rows.Count, "A").End(xlUp).Offset(1)<br>            <SPAN style="color:#00007F">Next</SPAN> i<br>        <SPAN style="color:#00007F">Next</SPAN> ws<br><SPAN style="color:#00007F">End</SPAN> <SPAN style="color:#00007F">Sub</SPAN></FONT>

HTH,
 

gsmitchell

New Member
Joined
Feb 11, 2006
Messages
34
Smitty, I am working on something similar and would like to ask how to modify your answer for my purpose. I have a workbook with 6 worksheets: Global, AP, LA, EU, NA, NL. I need the macro to look in column H in Global, and depending on the text ( which will be ap, la, eu, na, nl ) copy the entire row to the worksheet of the same name. There are approximately 120 rows in the workbook. Thanks!
 

Forum statistics

Threads
1,141,720
Messages
5,708,078
Members
421,545
Latest member
TWR

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Top