Hi Guys,
I have a problem with an Advanced Filter in that the macro returns an invalid result and I cannot identify why it is doing so.
this is my code:
The first macro does not work, however the second macro does. There is no difference in the coding so why should it fail???
Any ideas would be welcome,
greg
I have a problem with an Advanced Filter in that the macro returns an invalid result and I cannot identify why it is doing so.
this is my code:
Code:
Workbooks(strOutFile).Activate
Worksheets("tradebrand2").Activate
With Worksheets("tradebrand2")
Range("A1:CN1").Select
Range("A3:CN4000").AdvancedFilter Action:=xlFilterCopy, CriteriaRange:=Range( _
"A1:A2"), CopyToRange:=Range("DA1:GN4000"), Unique:=False
End With
Workbooks(strOutFile).Activate
Worksheets("tradebrand3").Activate
With Worksheets("tradebrand3")
Range("A1:C1").Select
Range("A3:C500").AdvancedFilter Action:=xlFilterCopy, CriteriaRange:=Range( _
"C1:C2"), CopyToRange:=Range("F1:H500"), Unique:=False
End With
The first macro does not work, however the second macro does. There is no difference in the coding so why should it fail???
Any ideas would be welcome,
greg