Macro - Filter data and copy to a new tab

Fisher1975

Board Regular
Joined
Jan 12, 2012
Messages
74
Hi

I have been trying to do the following, but without any success and would very much like some help

I want to do the following:

Sheet 1 - Select parameters for 3 columns in a sheet e.g. Product (Cell C3), Location (Cell C4), Date (Cell C5)

I then want to use the filter in sheet 2 (Row 3), filter on the said parameters (Product (Column B), Location (Column F), Date (Column J)) and copy the data to a new tab

Sheet 2 doesn't just have the said parameters above, it has many more

Hopefully someone can help
 

Excel Facts

Difference between two dates
Secret function! Use =DATEDIF(A2,B2,"Y")&" years"&=DATEDIF(A2,B2,"YM")&" months"&=DATEDIF(A2,B2,"MD")&" days"
If you are happy to change the layout of sheet 1 so that you have the headers in row1 & the criteria below like

Book1
ABC
1ProductLocationDate
2OrangeDorset01/01/1980
Sheet1


The headers much exactly match the headers in row 3 of Sheet2
You could use
Code:
Sub Fisher1975()
   Sheets("Sheet2").Range("A3").CurrentRegion.AdvancedFilter xlFilterCopy, Sheets("Sheet1").Range("A1:C2"), Sheets("sheet3").Range("A1"), False
End Sub
 
Upvote 0

Forum statistics

Threads
1,223,956
Messages
6,175,614
Members
452,661
Latest member
Nonhle

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