There is a requirement to sort 4 fields. The code is given below. Code runs without any error. However, rows are not sorted as required. Need your help - is there any error in the below VBA code.
Code
Set wbk = Workbooks.Open(strFile)
Set sht = wbk.Sheets("Details")
lastRow = Cells(Rows.Count, 2).End(xlUp).Row
LastCol = Cells(2, Columns.Count).End(xlToLeft).Column
Set source_data = Range(Cells(2, 2), Cells(lastRow, LastCol))
Set Ws = Sheets("Details")
With Ws.Sort
.SortFields.Clear
.SortFields.Add Key:=Ws.Range("B2"), Order:=xlAscending
.SortFields.Add Key:=Ws.Range("C2"), Order:=xlAscending
.SortFields.Add Key:=Ws.Range("K2"), Order:=xlAscending
.SortFields.Add Key:=Ws.Range("M2"), Order:=xlAscending
.SetRange Ws.Range("B2:U" & lastRow)
.Header = xlYes
.Apply
End With
wbk.Close savechanges:=True
Display More