Hello Community,
I've recently created a macro that filters a data set, copy's it, and then pastes it to another tab.
How to filter the data is read by a validated cell that has a drop down list. You select the components you want to filter and then press the macro button.
My problem arises that I have three categories to search by: Currency, Year, And Date for example My macro forces me to write a value in each one. So I can't pull up only a certain currency because if I leave the others blank the "filter" fails because there is no blank data set.
Any thoughts on how to fix this?
Here is the Macro:
Public Sub FilterCRNCY()Please Login or Register to view this content.
Sheets("Style 2").Select
Selection.AutoFilter Field:=7, Criteria1:=Range("D3").Value
Selection.AutoFilter Field:=8, Criteria1:=Range("D4").Value
Selection.AutoFilter Field:=, Criteria1:=Range("D5").Value
Range("A9:P11826").Select
Selection.Copy
Sheets("Data").Select
Range("A2").Select
ActiveSheet.Paste
'Erases filters:
Sheets("Style 2").Select
Selection.AutoFilter Field:=7
Selection.AutoFilter Field:=8
Selection.AutoFilter Field:=3
Sheets("Data").Select
End SubPlease Login or Register to view this content.
Bookmarks