Excel: Advanced Filtering VBA Code Issue

I am trying to do an advanced filter in VBA and the code structure came from a macro I recorded, with some changes to range references. I am getting the following error: "Run-time error '1004': Application-defined or object-defined error. I would appreciate if someone could help me identify where in the code I have gone wrong. In the previous section of the code I am creating a sheet two and renaming it Target Projects. Do I need to add that new sheet name to the "CopyToRange=Range(A1)" portion of the code? The Target Project sheet is activated after adding it and re-naming it, before this section of the code executes.

Sheets("DATA80100").Range(Cells(1, 1), Cells(Cells(Rows.Count, 1).End(xlUp).Row, DataMoCol)) _
        .AdvancedFilter Action:=xlFilterCopy, CriteriaRange:=Workbooks("Macro Launch Sheet).xlsm") _
        .Sheets("Sheet1").Range("BA1:BA36"), CopyToRange:=Range("A1"), Unique:=False
Thanks for any help you can give this novice.

This question generated 23 answers. To proceed to the answers, click here.

This thread is current as of February 07, 2018.

For more resources for Microsoft Excel