Hi,
I am using a macro that is derived from an article I found online. It is working right now, but because I don't know how to modify the macro well enough, I defaulted to making the range in the code to be a range which I know we will never extend beyond in our speadsheet.
Basically this just sorts every single column individually in ascending order. It takes a VERY long time to run because it keeps trying to do this for all columns through to AZZ. It would be better if it knew where the last column and row with data was and then only performed the action for that range.
Is that possible?
Here is my current code:
Sub Sort_AllClmnIndependently()
' This macro individually sorts all columns alphabetically in ascending order, the sorting is done 1 by 1 and is not predicated upon another column.
Dim Cols As Range, i As Integer
Set Cols = Range("B2:AZZ300")
For i = 0 To Cols.Columns.Count
Cols.Columns(i).Sort Key1:=Cols.Columns(i), Order1:=xlAscending, _
Header:=xlNo, OrderCustom:=1, MatchCase:=False, Orientation:=xlTopToBottom
Next i
End Sub
Bookmarks