Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1,119
Default Macro giving runtime error on one PC and not another

Remove the DataOption2:= xlSortNormal. It is a new feature in 2003 that did
not exist in 2000. xlSortNormal is the default so it does not make a
difference anyway...

--
HTH...

Jim Thomlinson


"Ingrid" wrote:

In the following code, the macro gives a runtime error 1004: application or
object defined error at the Selection.Sort command.

Sheets("Data").Select
Cells.Select
Selection.Font.Bold = False
Selection.Sort Key1:=Range("A2"), Order1:=xlDescending,
Key2:=Range("B2") _
, Order2:=xlDescending, Header:=xlYes, OrderCustom:=1,
MatchCase:=False _
, Orientation:=xlTopToBottom, DataOption1:=xlSortNormal,
DataOption2:= _
xlSortNormal


The macro works fine for me with Excel 2003, but not for my friend who has
Excel 2000. Is there something in the code that could be removed and still
let the macro function on his pc?

Or is there a setting in his Excel that needs to be changed to allow this to
work?

Thanks!

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
Runtime error in Macro. Tel Excel Discussion (Misc queries) 4 July 20th 09 02:21 PM
macro Runtime Error Dave 2005 Excel Discussion (Misc queries) 1 October 18th 05 10:02 PM
Excel 2003 Macro Error - Runtime error 1004 Cow Excel Discussion (Misc queries) 2 June 7th 05 01:40 PM
naming tab macro error runtime error 1004 D Excel Programming 3 February 28th 05 01:32 AM
Excel help giving runtime error Hari Prasadh Excel Discussion (Misc queries) 1 January 21st 05 01:23 PM


All times are GMT +1. The time now is 12:16 AM.

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

About Us

"It's about Microsoft Excel"