Copy rows of multiple worsheet to new workbook based on cell condition

beegeeblueboy

New Member
Joined
Mar 25, 2010
Messages
29
Have been trying to do this with macro recorder and then realised not possible.


  1. With workbook open check if worksheet name 'Combined' and if not create it.
  2. With workbook open check if worksheet name 'Errors' and if not create it.
  3. Activate first worksheet. Read each row and if cell A = "Y" select row and copy to the first empty row into worksheet 'Combined' from column 'B' and insert source worksheet name from column 'A'. (This identifies the source worksheet name for each row)
  4. If value in source cell A <> 'Y' then repeat 3 but copy into workbook 'Errors'
  5. Loop until end of active worksheet and then activate next worksheet and repeat 3 and 4
  6. When last worksheet has been processed close workbook invoking Save dialogue
I suspect that this is not to complicated to anyone who is not a novice.


Thank you


Julian
 
Last edited:

Excel Facts

What is the shortcut key for Format Selection?
Ctrl+1 (the number one) will open the Format dialog for whatever is selected.

Forum statistics

Threads
1,216,081
Messages
6,128,694
Members
449,464
Latest member
againofsoul

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
Back
Top