Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1,049
Default Code not working in Excel 2007


to check this i added

dim target as range
set target = selecttion

and in your code replaced Selection by target so the line that starts
Selection.Sort
became
target.Sort

my demo file worked for both versions of Excel.

in my demo, the selected cell was the row label 'Month'





"abajo" wrote in message
...
Any Idea why the following macro code returns this error:
"Run-time error '1004': Sort Method of Range Class failed". The code
works
fine in Office Excel 2003.

ActiveSheet.PivotTables(pivName).PivotSelect "month[All]", xlLabelOnly
Selection.Sort Order1:=xlAscending, Type:=xlSortLabels,
OrderCustom:=csort, Orientation:=xlTopToBottom

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
F2 Key not working in Excel 2007 JodieM Excel Discussion (Misc queries) 2 November 18th 10 08:21 PM
Code in 2003 not working in 2007 GregK Excel Programming 9 September 18th 08 12:55 PM
2007 code not working in 2003 Imran J Khan Excel Programming 5 September 2nd 08 09:00 PM
Excel 2007 Macro Help (Excel 2003 not working in 2007) Pman Excel Discussion (Misc queries) 4 May 29th 08 06:29 PM
Code not working since upgrade to 2007 Terry K Excel Programming 2 January 4th 08 07:39 PM


All times are GMT +1. The time now is 05:46 PM.

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"