pedie
Well-known Member
- Joined
- Apr 28, 2010
- Messages
- 3,875
Hi, how can i sort by activecell. column.
My static Data is in range D9:W22
Thanks you.
is this the correct way?
How do i add if active cell is not in ("D9:W22") to exit sub?
My static Data is in range D9:W22
Thanks you.
is this the correct way?
Rich (BB code):
Sub SortMe()
Sheet1.Activate
ActiveSheet.Sort.SortFields.Clear
ActiveSheet.Sort.SortFields.Add Key:=Cells( _
Selection.Column), SortOn:=xlSortOnValues, Order:=xlAscending, DataOption:= _
xlSortNormal
With ActiveSheet.Sort
.SetRange Range("D9:W22")
.Header = xlGuess
.MatchCase = False
.Orientation = xlTopToBottom
.SortMethod = xlPinYin
.Apply
End With
Range("A1").Select
End Sub
How do i add if active cell is not in ("D9:W22") to exit sub?
Last edited: