Hi all,
Hope you can help, I am trying to sort data in multiple columns for a specfic range within a sheet, this code almost looks like it wants to work but I keep getting mismatch error. I want to sort only within the range "B4:ET404" and there is no header...can someone please help me with the right coding?? I would appreciate it very much!
Sub MultiSort()
Dim Cols As Range, i As Integer
Set Cols = Selection
For i = Range("B:ET") To Cols.Columns.Count
Cols.Columns(i).Sort Key1:=Cols.Columns(i).Cells(4, 404), _
Order1:=xlAscending, Header:=xlNo, _
OrderCustom:=1, MatchCase:=False, _
Orientation:=xlTopToBottom
Next i
End Sub
Hope you can help, I am trying to sort data in multiple columns for a specfic range within a sheet, this code almost looks like it wants to work but I keep getting mismatch error. I want to sort only within the range "B4:ET404" and there is no header...can someone please help me with the right coding?? I would appreciate it very much!
Sub MultiSort()
Dim Cols As Range, i As Integer
Set Cols = Selection
For i = Range("B:ET") To Cols.Columns.Count
Cols.Columns(i).Sort Key1:=Cols.Columns(i).Cells(4, 404), _
Order1:=xlAscending, Header:=xlNo, _
OrderCustom:=1, MatchCase:=False, _
Orientation:=xlTopToBottom
Next i
End Sub