gazitaliano
New Member
Hi I'm having a problem filtering data.
I downloaded the 'Extract data using advanced filter with vba' file and have amended the vba code to suit my own workbook, however when I click on my get data button it only copies over the headers from my table, not the data?
This is the code I have:
Sub getdata1()
Sheets("Sheet2").Select
Range("S8").Select
Range(Selection, Selection.End(xlToRight)).Select
Range(Selection, Selection.End(xlDown)).Select
Selection.Clear
Sheets("Sheet1").Range("Table1[#All]").AdvancedFilter Action:=xlFilterCopy, CriteriaRange:= _
Sheets("Sheet1").Range("W1:X2"), CopyToRange:=Sheets("Sheet2").Range("S8"), Unique:=True
Columns.AutoFit
Range("S8").Select
End Sub
Any help would be great. Thanks
I downloaded the 'Extract data using advanced filter with vba' file and have amended the vba code to suit my own workbook, however when I click on my get data button it only copies over the headers from my table, not the data?
This is the code I have:
Sub getdata1()
Sheets("Sheet2").Select
Range("S8").Select
Range(Selection, Selection.End(xlToRight)).Select
Range(Selection, Selection.End(xlDown)).Select
Selection.Clear
Sheets("Sheet1").Range("Table1[#All]").AdvancedFilter Action:=xlFilterCopy, CriteriaRange:= _
Sheets("Sheet1").Range("W1:X2"), CopyToRange:=Sheets("Sheet2").Range("S8"), Unique:=True
Columns.AutoFit
Range("S8").Select
End Sub
Any help would be great. Thanks