Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default macro works at home but not at work


Hi All

I have a macro that works fine at home but on none of work pc's. I have
saved the document as an excel 97-2003 worksheet as that is what all
other users have done (and their macro's work fine). Most of the code
works apart from the sort section.

Any advice anyone? Here is the code, (its the xlSortOnValues that goes
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 Sub
--------------------


--
markrennolds
------------------------------------------------------------------------
markrennolds's Profile: http://www.thecodecage.com/forumz/member.php?userid=543
View this thread: http://www.thecodecage.com/forumz/sh...d.php?t=120767

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 10,124
Default macro works at home but not at work


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

"markrennolds" wrote in message
...

Hi All

I have a macro that works fine at home but on none of work pc's. I have
saved the document as an excel 97-2003 worksheet as that is what all
other users have done (and their macro's work fine). Most of the code
works apart from the sort section.

Any advice anyone? Here is the code, (its the xlSortOnValues that goes
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 Sub
--------------------


--
markrennolds
------------------------------------------------------------------------
markrennolds's Profile:
http://www.thecodecage.com/forumz/member.php?userid=543
View this thread:
http://www.thecodecage.com/forumz/sh...d.php?t=120767


Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Macro works Macro does not work Wanna Learn Excel Discussion (Misc queries) 4 March 24th 08 12:51 PM
macro doesn't work on Excel for the mac but works on Windows XL?? Dave F Excel Programming 3 December 27th 06 08:07 PM
I moved a file from work to home and now my color macro does not w nick s Excel Worksheet Functions 2 December 3rd 05 02:39 PM
Simple Macro, works in Excel 2002, 2003 but won't work in 2000 DJA[_2_] Excel Programming 5 September 28th 05 05:10 PM
xyScatterChart macro works on WinXP Pro & not on WinXP Home? [email protected] Excel Discussion (Misc queries) 0 July 18th 05 12:30 AM


All times are GMT +1. The time now is 02:04 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"