macro works at home but not at work

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
 
D

Don Guillett

Some "features" of 2007 such as this are not backward compatible. Develop in
your older version and simply save as a "microsoft excel file" which is
..xls. Should now run in all versions.

-
Don Guillett
Microsoft MVP Excel
SalesAid Software
(e-mail address removed)
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top