Conditionally Copy Multiple Rows

dsol828

New Member
Joined
Jun 27, 2011
Messages
3
Hello all,

I've been looking for a way to solve an excel problem of mine with little success.

I have a large table and would like to copy only the rows with a specific value.
My problem is that the value I'm looking for can be found in one of two columns.

Most of the autofilters i've come across only search for the value in one column.

Would anyone be able to provide some Macro or similar code?

Thanks!
 

Excel Facts

Which lookup functions find a value equal or greater than the lookup value?
MATCH uses -1 to find larger value (lookup table must be sorted ZA). XLOOKUP uses 1 to find values greater and does not need to be sorted.
1. Get last row of data.
2. Autofilter one of these two columns.
3. Copy only visible cells with SpecialCells(xlCellTypeVisible).
4. Remove autofilter.

Then filter another column.
 
Upvote 0
Have you used Advanced Filter before? It lets you filter for the same value across multiple columns if you need to.
This page has some examples to get you started.

Denis
 
Upvote 0
Thanks for the answers guys.

That advanced filtering is by far the easiest way to get there. Had no idea there was already a tool for that within Excel.

Thanks!
 
Upvote 0

Forum statistics

Threads
1,224,521
Messages
6,179,289
Members
452,902
Latest member
Knuddeluff

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