Competition
New Member
- Joined
- Sep 19, 2011
- Messages
- 34
Hi
I've tried finding this answer in here, but have had no luck, I have created a macro to cut and paste large amount of raw data into a spreadsheet. Once that is completed I want to filter the data on very specific criteria. However the catch is that I don't want the filter attached to one specific worksheet. I want it to apply to what ever worksheet is open at the time.
Here is the code:
ActiveWorkbook.Worksheets("Sept 26").AutoFilter.Sort.SortFields.Clear
ActiveWorkbook.Worksheets("Sept 26").AutoFilter.Sort.SortFields.Add _Key:=Range("A3:A2832"), SortOn:=xlSortOnValues, Order:=xlAscending, _DataOption:=xlSortNormal
ActiveWorkbook.Worksheets("Sept 26").AutoFilter.Sort.SortFields.Add _Key:=Range("G3:G2832"), SortOn:=xlSortOnValues, Order:=xlDescending, _DataOption:=xlSortNormal
ActiveWorkbook.Worksheets("Sept 26").AutoFilter.Sort.SortFields.Add _Key:=Range("J3:J2832"), SortOn:=xlSortOnValues, Order:=xlDescending, _DataOption:=xlSortNormal
With ActiveWorkbook.Worksheets("Sept 26").AutoFilter.Sort
.Header = xlYes
.MatchCase = False
.Orientation = xlTopToBottom
.SortMethod = xlPinYin
.Apply
End With
Basically I want to remove the reference to Sept 26... Can anyone help?
Thanks
I've tried finding this answer in here, but have had no luck, I have created a macro to cut and paste large amount of raw data into a spreadsheet. Once that is completed I want to filter the data on very specific criteria. However the catch is that I don't want the filter attached to one specific worksheet. I want it to apply to what ever worksheet is open at the time.
Here is the code:
ActiveWorkbook.Worksheets("Sept 26").AutoFilter.Sort.SortFields.Clear
ActiveWorkbook.Worksheets("Sept 26").AutoFilter.Sort.SortFields.Add _Key:=Range("A3:A2832"), SortOn:=xlSortOnValues, Order:=xlAscending, _DataOption:=xlSortNormal
ActiveWorkbook.Worksheets("Sept 26").AutoFilter.Sort.SortFields.Add _Key:=Range("G3:G2832"), SortOn:=xlSortOnValues, Order:=xlDescending, _DataOption:=xlSortNormal
ActiveWorkbook.Worksheets("Sept 26").AutoFilter.Sort.SortFields.Add _Key:=Range("J3:J2832"), SortOn:=xlSortOnValues, Order:=xlDescending, _DataOption:=xlSortNormal
With ActiveWorkbook.Worksheets("Sept 26").AutoFilter.Sort
.Header = xlYes
.MatchCase = False
.Orientation = xlTopToBottom
.SortMethod = xlPinYin
.Apply
End With
Basically I want to remove the reference to Sept 26... Can anyone help?
Thanks