D
Dan
Can someone help me understand why this macro works in Excel 2007 but not on
Excel 2003?
Sub Sort_Donors()
'
' Sort_Donors Macro
'
' Keyboard Shortcut: Ctrl+Shift+S
'
Application.Goto Reference:="NameList"
ActiveWorkbook.Worksheets("Donor List").Sort.SortFields.Clear
ActiveWorkbook.Worksheets("Donor List").Sort.SortFields.Add
Key:=ActiveCell. _
Range("A1:A100"), SortOn:=xlSortOnValues, Order:=xlAscending,
DataOption _
:=xlSortNormal
With ActiveWorkbook.Worksheets("Donor List").Sort
.SetRange ActiveCell.Offset(-1, 0).Range("A1:A101")
.Header = xlYes
.MatchCase = False
.Orientation = xlTopToBottom
.SortMethod = xlPinYin
.Apply
End With
Range("A1").Select
End Sub
Excel 2003?
Sub Sort_Donors()
'
' Sort_Donors Macro
'
' Keyboard Shortcut: Ctrl+Shift+S
'
Application.Goto Reference:="NameList"
ActiveWorkbook.Worksheets("Donor List").Sort.SortFields.Clear
ActiveWorkbook.Worksheets("Donor List").Sort.SortFields.Add
Key:=ActiveCell. _
Range("A1:A100"), SortOn:=xlSortOnValues, Order:=xlAscending,
DataOption _
:=xlSortNormal
With ActiveWorkbook.Worksheets("Donor List").Sort
.SetRange ActiveCell.Offset(-1, 0).Range("A1:A101")
.Header = xlYes
.MatchCase = False
.Orientation = xlTopToBottom
.SortMethod = xlPinYin
.Apply
End With
Range("A1").Select
End Sub