Tried this code. still not working
Sub Macro7()
Dim rng As Range
Set rng = Range(Range("L2"), Range("L3").End(xlDown))
rng.Select
ActiveWorkbook.Worksheets("Sheet1").Sort.SortFields.Clear
ActiveWorkbook.Worksheets("Sheet1").Sort.SortFields.Add Key:=Range(Range("L3"), Range("L3").End(xlDown)) _
, SortOn:=xlSortOnValues, Order:=xlAscending, DataOption:=xlSortNormal
Dim LR As Long
Dim rLastCell As Range
With ActiveWorkbook.Worksheets("Sheet1").Sort
' .SetRange Range("A2:L100")
Set rLastCell = .Cells.Find("*", .Cells(12, 2), xlValues, xlPart, , xlPrevious)
.SetRange (.Range("L2").rLastCell)
.Header = xlYes
.MatchCase = False
' .Orientation = xlTopToBottom
.SortMethod = xlPinYin
.Apply
End With
End Sub
Would be glad if someone could assist me .
I am unable to set the range inside the "WITH" .. "END WITH" option used in my code
Bookmarks