Callum2010
New Member
- Joined
- Mar 29, 2012
- Messages
- 3
Hi
I was after some assitance performing a data sort on a range that is dynamic as opposed to fixed. However the range A21:AA755 will grow over time.
Does anyone have any idea?
Currently i have the following code
Sub Sort()
' Sort Macro
Application.ScreenUpdating = False
Sheet1.Unprotect Password:="maso1975"
Range("A21:AA755").Sort Key1:=Range("S22"), Order1:=xlAscending, Key2:= _
Range("Q22"), Order2:=xlAscending, Header:=xlGuess, OrderCustom:=6, _
MatchCase:=False, Orientation:=xlTopToBottom, DataOption1:=xlSortNormal, _
DataOption2:=xlSortNormal, Key3:=Range("N22"), Order1:=xlAscending
Sheet1.Protect Password:="maso1975", AllowFiltering:=True, DrawingObjects:=False
Application.Goto Reference:=Range("Q22"), Scroll:=True
ActiveSheet.Range("S21").Select
Application.ScreenUpdating = True
End Sub
I was after some assitance performing a data sort on a range that is dynamic as opposed to fixed. However the range A21:AA755 will grow over time.
Does anyone have any idea?
Currently i have the following code
Sub Sort()
' Sort Macro
Application.ScreenUpdating = False
Sheet1.Unprotect Password:="maso1975"
Range("A21:AA755").Sort Key1:=Range("S22"), Order1:=xlAscending, Key2:= _
Range("Q22"), Order2:=xlAscending, Header:=xlGuess, OrderCustom:=6, _
MatchCase:=False, Orientation:=xlTopToBottom, DataOption1:=xlSortNormal, _
DataOption2:=xlSortNormal, Key3:=Range("N22"), Order1:=xlAscending
Sheet1.Protect Password:="maso1975", AllowFiltering:=True, DrawingObjects:=False
Application.Goto Reference:=Range("Q22"), Scroll:=True
ActiveSheet.Range("S21").Select
Application.ScreenUpdating = True
End Sub