Why doesn't work this macro?
I receive an error message on the line :
Range("A5").PasteSpecial
This is my macro :
Sub Filter()
currentworkbook = ActiveWorkbook.Name
currentsheet = ActiveSheet.Name
Columns("L:L").Select
Selection.autofilter Field:=1, Criteria1:="1"
Range("A5:" & Range("K65536").End(xlUp).Address).Copy
Workbooks.OpenText Filename:="G:Mijn documentenMap1.xls"
Sheets("Blad1").Select
Range("A5").PasteSpecial
Workbooks(currentworkbook).Sheets(currentsheet).Activate
Selection.autofilter
Range("A1").Select
End Sub
Many thanks for help.
I receive an error message on the line :
Range("A5").PasteSpecial
This is my macro :
Sub Filter()
currentworkbook = ActiveWorkbook.Name
currentsheet = ActiveSheet.Name
Columns("L:L").Select
Selection.autofilter Field:=1, Criteria1:="1"
Range("A5:" & Range("K65536").End(xlUp).Address).Copy
Workbooks.OpenText Filename:="G:Mijn documentenMap1.xls"
Sheets("Blad1").Select
Range("A5").PasteSpecial
Workbooks(currentworkbook).Sheets(currentsheet).Activate
Selection.autofilter
Range("A1").Select
End Sub
Many thanks for help.