M
markrennolds
Hi All
I have a macro that works fine at home but on none of work pc's. I hav
saved the document as an excel 97-2003 worksheet as that is what al
other users have done (and their macro's work fine). Most of the cod
works apart from the sort section.
Any advice anyone? Here is the code, (its the xlSortOnValues that goe
wrong first, not sure if there will be other errors after that?)
Thanks
Mark
Code
-------------------
'Sort
Sheets("Area Summary").Range("B7:M31").Select
Application.CutCopyMode = False
ActiveWorkbook.Worksheets("Area Summary").Sort.SortFields.Clear
ActiveWorkbook.Worksheets("Area Summary").Sort.SortFields.Add Key:=Range( _
"M8:M31"), SortOn:=xlSortOnValues, Order:=xlDescending, DataOption:= _
xlSortNormal
ActiveWorkbook.Worksheets("Area Summary").Sort.SortFields.Add Key:=Range( _
"E8:E31"), SortOn:=xlSortOnValues, Order:=xlDescending, DataOption:= _
xlSortTextAsNumbers
With ActiveWorkbook.Worksheets("Area Summary").Sort
.SetRange Range("B7:M31")
.Header = xlYes
.MatchCase = False
.Orientation = xlTopToBottom
.SortMethod = xlPinYin
.Apply
End With
Range("B3").Select
End Su
I have a macro that works fine at home but on none of work pc's. I hav
saved the document as an excel 97-2003 worksheet as that is what al
other users have done (and their macro's work fine). Most of the cod
works apart from the sort section.
Any advice anyone? Here is the code, (its the xlSortOnValues that goe
wrong first, not sure if there will be other errors after that?)
Thanks
Mark
Code
-------------------
'Sort
Sheets("Area Summary").Range("B7:M31").Select
Application.CutCopyMode = False
ActiveWorkbook.Worksheets("Area Summary").Sort.SortFields.Clear
ActiveWorkbook.Worksheets("Area Summary").Sort.SortFields.Add Key:=Range( _
"M8:M31"), SortOn:=xlSortOnValues, Order:=xlDescending, DataOption:= _
xlSortNormal
ActiveWorkbook.Worksheets("Area Summary").Sort.SortFields.Add Key:=Range( _
"E8:E31"), SortOn:=xlSortOnValues, Order:=xlDescending, DataOption:= _
xlSortTextAsNumbers
With ActiveWorkbook.Worksheets("Area Summary").Sort
.SetRange Range("B7:M31")
.Header = xlYes
.MatchCase = False
.Orientation = xlTopToBottom
.SortMethod = xlPinYin
.Apply
End With
Range("B3").Select
End Su