I have a macro that I have to run on 6 different worksheets. Each sheet has a different name. Rather than having to edit the macro to coorespond with the specific sheet that I am running, is there a way to use a wildcard for the sheet name that will allow it to run?
Here is the portion of the macro that has to be edited each time to the different file name. ("FW CONVERSION")
ActiveWorkbook.Worksheets("FW CONVERSION").Sort.SortFields.Clear
ActiveWorkbook.Worksheets("FW CONVERSION").Sort.SortFields.Add Key:=Range( _
"B2:B30000"), SortOn:=xlSortOnValues, Order:=xlAscending, DataOption:= _
xlSortTextAsNumbers
With ActiveWorkbook.Worksheets("FW CONVERSION").Sort
.SetRange Range("A1:V30000")
.Header = xlYes
.MatchCase = False
.Orientation = xlTopToBottom
.SortMethod = xlPinYin
.Apply
End With
End Sub
Bookmarks