I have a macro that I wrote for a specific spreadsheet and I now want to use that macro for other sheets that contain the same data, but have a different worksheet name. I want the macro to ignore the first to characters of the sheet name and I am unsure how to do this.
Here is the specific part of the macro where the sheet name comes into play. I would like the macro to ignore the sheet name all together or just the first 2 characters, because that is the only difference between the speadsheets that I will run it against.
Cells.Select
ActiveWorkbook.Worksheets("FW POG CONVERSION REFRESH FILE").Sort.SortFields. _
Clear
ActiveWorkbook.Worksheets("FW POG CONVERSION REFRESH FILE").Sort.SortFields. _
Add Key:=Range("A2:A34239"), SortOn:=xlSortOnValues, Order:=xlAscending, _
DataOption:=xlSortNormal
ActiveWorkbook.Worksheets("FW POG CONVERSION REFRESH FILE").Sort.SortFields. _
Add Key:=Range("H2:H34239"), SortOn:=xlSortOnValues, Order:=xlAscending, _
DataOption:=xlSortNormal
With ActiveWorkbook.Worksheets("FW POG CONVERSION REFRESH FILE").Sort
.SetRange Range("A1:S34239")
.Header = xlYes
.MatchCase = False
.Orientation = xlTopToBottom
.SortMethod = xlPinYin
.Apply
Bookmarks