Using a Macro to Copy Rows based on multiple Column Values

krewert

New Member
Joined
Jun 26, 2014
Messages
1
I have a set of data as follows:

Column names in the first row of columns B:G
Column B: Employee Number (unique ID)
Column C: Name
Columns D:G: Either blank or contain a number
Data begins on the 2nd row of each column


I'm on excel 2010 and looking for a macro that will copy any rows from a table (that could change in length) that have a number in either column D,E,F, or G and create a new sheet and place those rows (along with the original column headings) on that sheet in a table.

Does anyone know the code for a macro that could accomplish this? I only know one that does it based on filtering one column, but in this case there are 4 that could possibly have values in them.

Any help would be much appreciated - Thanks in advance
 

Excel Facts

Who is Mr Spreadsheet?
Author John Walkenbach was Mr Spreadsheet until his retirement in June 2019.

Forum statistics

Threads
1,223,236
Messages
6,170,906
Members
452,366
Latest member
TePunaBloke

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