I created a marco and tried to copy it into an existing VBA code to sort a worksheet by column F then E Ascending but it does not appear to be working.
VBA Code:
With ActiveWorkbook.Worksheets("Municipal Purchase").Sort
ActiveWorkbook.Worksheets("Municipal Purchase").Sort.SortFields.Clear
ActiveWorkbook.Worksheets("Municipal Purchase").Sort.SortFields.Add Key:=Range( _
"E2:E" & LastRow), SortOn:=xlSortOnValues, Order:=xlAscending, DataOption:= _
xlSortTextAsNumbers
ActiveWorkbook.Worksheets("Municipal Purchase").Sort.SortFields.Add Key:=Range( _
"D2:D" & LastRow), SortOn:=xlSortOnValues, Order:=xlAscending, DataOption:= _
xlSortTextAsNumbers
With ActiveWorkbook.Worksheets("Municipal Purchase").Sort
.SetRange Range("A1:AZ" & LastRow)
.Header = xlYes
.MatchCase = False
.Orientation = xlTopToBottom
.SortMethod = xlPinYin
.Apply
End With