Copy Conditional Date to New Sheet Macro

AmyQtoe

New Member
Joined
Sep 14, 2011
Messages
1
Hello,

I am trying to correct a very simple macro for filtering and copying data from "Master" sheet to a second "Complete" and third "In Progress" sheet. I would like to filter rows denoted with the data "C" in the "Master" sheet to the sheet "Complete." Rows with data "IP" will be filtered and copied to sheet "In Progress." All data should remain in "Master" sheet; just copied over.

I've created a sheet called "Criteria" in the workbook, which contains the ="C" criteria in cells H1:H2 and the ="IP" criteria in cells I1:I2.

Here is what I have:


Sub FilterCopyToOtherSheet()
'
Sheets("Master").Range("1:1048576").AdvancedFilter _
Action = x1FilterCopy, _
CriteriaRange:=Sheets("Criteria").Range("H1:H2"), _
CopyToRange:=Sheets("Complete").Range("A1:W1"), _
Unique:=False

Sheets("Master").Range("1:1048576").AdvancedFilter _
Action = x1FilterCopy, _
CriteriaRange:=Sheets("Criteria").Range("I1:I2"), _
CopyToRange:=Sheets("In Progress").Range("A1:W1"), _
Unique:=False

End Sub

Unfortunately, It is only filtering the data in "Master" not actually copying it over to sheets "Complete" and "In Progress."

Any help or correcting of my code would be greatly appreciated.

Thank you,
Amy
 

Excel Facts

Create a chart in one keystroke
Select the data and press Alt+F1 to insert a default chart. You can change the default chart to any chart type

Forum statistics

Threads
1,224,566
Messages
6,179,553
Members
452,928
Latest member
101blockchains

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