M
mpb
Good Evening All,
I have below short code for a macro to sort a list using
advanced filter copy unique values to another worksheet.
I also like to have the Autofilter enabled on both
worksheets. However, when the macro is run, the Autofilter
on the source worksheet ("Invoice Record"), is lost and
has to be re-enabled manually.
This is annoying glich, and a fix would be most welcome.
Cheers, Cordially
MPB
Sub ECRGeneralReportPopulation()
' General Report Data Population From Invoice Record
Application.Interactive = False
Dim myRng As Range
Sheets("General Report").Range("A:A").ClearContents
With Sheets("Invoice Record")
Set myRng = .Range("A2", .Cells(.Rows.Count, "A").End
(xlUp))
End With
myRng.AdvancedFilter Action:=xlFilterCopy, _
CopyToRange:=Sheets("General Report").Range("A2"),
Unique:=True
Application.Interactive = True
End Sub
I have below short code for a macro to sort a list using
advanced filter copy unique values to another worksheet.
I also like to have the Autofilter enabled on both
worksheets. However, when the macro is run, the Autofilter
on the source worksheet ("Invoice Record"), is lost and
has to be re-enabled manually.
This is annoying glich, and a fix would be most welcome.
Cheers, Cordially
MPB
Sub ECRGeneralReportPopulation()
' General Report Data Population From Invoice Record
Application.Interactive = False
Dim myRng As Range
Sheets("General Report").Range("A:A").ClearContents
With Sheets("Invoice Record")
Set myRng = .Range("A2", .Cells(.Rows.Count, "A").End
(xlUp))
End With
myRng.AdvancedFilter Action:=xlFilterCopy, _
CopyToRange:=Sheets("General Report").Range("A2"),
Unique:=True
Application.Interactive = True
End Sub