I don't know why I'm having issues with sorting, as I've done it a number of times in other projects. I've referred to my old code, as well as the web and I've tried the following snippets to no avail. I keep getting a "subscript out of range" error. Even when I copy and paste the macro recorder's snippet, I get an error.
VBA Code:
'***Attempt 1
'ActiveWorkbook.Worksheets("DOADS").Sort Key:=Range("AH1:AH" & mPNLR), SortOn:=xlSortOnValues, Order:=xlAscending, DataOption:=xlSortTextAsNumbers
'With ActiveWorkbook.Worksheets("DOADS").Sort
' .SetRange Range("AH2:AH" & mPNLR)
' .Header = xlNo
' .MatchCase = False
' .Orientation = xlTopToBottom
' .SortMethod = xlPinYin
' .Apply
'End With
'Attempt 2
'mP.Range("AH1:AH" & mPNLR).Sort Key1:=Range("AH1"), order1:=xlAscending, Header:=xlYes
'Attempt 3
'mP.Sort.SortFields.Clear
'mP.Sort.SortFields.Add Key:=mP.Range("AH1:AH" & mPNLR), SortOn:=xlSortOnValues, Order:=xlAscending, DataOption:=xlSortNormal, Header:=xlYes
'Attempt 4
'mP.Range("AH1:AH" & mPNLR).Sort Key:=mP.Range("AH1:AH" & mPNLR), Order:=xlAscending, Header:=xlYes
'Attempt 5
'ActiveWorkbook.Worksheets("Names").Sort.SortFields.Clear
ActiveWorkbook.Worksheets("Names").Sort.SortFields.Add Key:=Range("AF1:AF" & mLiqLR), SortOn:=xlSortOnValues, Order:=xlAscending, DataOption:=xlSortTextAsNumbers
'With ActiveWorkbook.Worksheets("Names").Sort
' .SetRange Range("AF2:AF" & mLiqLR)
' .Header = xlNo
' .MatchCase = False
' .Orientation = xlTopToBottom
' .SortMethod = xlPinYin
' .Apply
'End With