P
Patrick C. Simonds
Is it possible to edit the Sort Routine so that when the sort is completed,
the Range("B6:G1000") will be deselected and the active cell will be the
cell that was active when the Sort Routine started?
Sub SortNames()
'
' Macro1 Macro
'
'
Application.ScreenUpdating = False
ActiveWindow.SmallScroll Down:=-6
Range("B6:G1000").Select
ActiveWorkbook.Worksheets("Jan 08").Sort.SortFields.Clear
ActiveWorkbook.Worksheets("Jan 08").Sort.SortFields.Add
Key:=Range("B6:B1000" _
), SortOn:=xlSortOnValues, Order:=xlAscending,
DataOption:=xlSortNormal
With ActiveWorkbook.Worksheets("Jan 08").Sort
.SetRange Range("B6:G1000")
.Header = xlGuess
.MatchCase = False
.Orientation = xlTopToBottom
.SortMethod = xlPinYin
.Apply
End With
Application.ScreenUpdating = True
End Sub
the Range("B6:G1000") will be deselected and the active cell will be the
cell that was active when the Sort Routine started?
Sub SortNames()
'
' Macro1 Macro
'
'
Application.ScreenUpdating = False
ActiveWindow.SmallScroll Down:=-6
Range("B6:G1000").Select
ActiveWorkbook.Worksheets("Jan 08").Sort.SortFields.Clear
ActiveWorkbook.Worksheets("Jan 08").Sort.SortFields.Add
Key:=Range("B6:B1000" _
), SortOn:=xlSortOnValues, Order:=xlAscending,
DataOption:=xlSortNormal
With ActiveWorkbook.Worksheets("Jan 08").Sort
.SetRange Range("B6:G1000")
.Header = xlGuess
.MatchCase = False
.Orientation = xlTopToBottom
.SortMethod = xlPinYin
.Apply
End With
Application.ScreenUpdating = True
End Sub