Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 16
Default Broken macro in Excel 2003: part II

I posted on this once before and got some advice that I've followed up on
(thanks!) I sp1 installed and tried the registry edit mentioned in article
831824, but no luck there so I've set it back to its original setting. I
think I've come up with some of the offending code that ran well in Excel
2000 but breaks in Excel 2003. As of the first line of this code, all of the
applicable data is selected, but by the time it gets to the end there are
many rows that fall below the bottom of the selection.

' Subtotal by company name
Range("A5", Range("A5").End(xlDown).End(xlToRight)).Select
Selection.Subtotal GroupBy:=1, Function:=xlSum, TotalList:=Array(5), _
Replace:=False, PageBreaks:=False, SummaryBelowData:=True
Range("A5", Range("A5").End(xlToRight).End(xlDown)).Select
Selection.Subtotal GroupBy:=2, Function:=xlSum, TotalList:=Array(5), _
Replace:=False, PageBreaks:=False, SummaryBelowData:=True

Any ideas that you can provide will be greatly appreciated.

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 16
Default Broken macro in Excel 2003: part II

Actually I see now why that is so never mind. Sorry, I'll keep hunting

"kmbarz" wrote:

I posted on this once before and got some advice that I've followed up on
(thanks!) I sp1 installed and tried the registry edit mentioned in article
831824, but no luck there so I've set it back to its original setting. I
think I've come up with some of the offending code that ran well in Excel
2000 but breaks in Excel 2003. As of the first line of this code, all of the
applicable data is selected, but by the time it gets to the end there are
many rows that fall below the bottom of the selection.

' Subtotal by company name
Range("A5", Range("A5").End(xlDown).End(xlToRight)).Select
Selection.Subtotal GroupBy:=1, Function:=xlSum, TotalList:=Array(5), _
Replace:=False, PageBreaks:=False, SummaryBelowData:=True
Range("A5", Range("A5").End(xlToRight).End(xlDown)).Select
Selection.Subtotal GroupBy:=2, Function:=xlSum, TotalList:=Array(5), _
Replace:=False, PageBreaks:=False, SummaryBelowData:=True

Any ideas that you can provide will be greatly appreciated.

  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 16
Default Broken macro in Excel 2003: part II

Success! Apparently when the macro would run in Excel 2000, there was a
blank line in between the last subtotal and the grand total. So, the
original programmer (whoever that was) added the second line here to deal
with that (which I fixed by commenting out. Net effect on Excel 2003 was
that the last subtotal disappeared causing a corrupt report.

Rows(SheetLastRow - 1).Select
'Selection.Delete Shift:=xlUp
Columns("A:A").EntireColumn.AutoFit
Columns("B:B").EntireColumn.AutoFit



"kmbarz" wrote:

I posted on this once before and got some advice that I've followed up on
(thanks!) I sp1 installed and tried the registry edit mentioned in article
831824, but no luck there so I've set it back to its original setting. I
think I've come up with some of the offending code that ran well in Excel
2000 but breaks in Excel 2003. As of the first line of this code, all of the
applicable data is selected, but by the time it gets to the end there are
many rows that fall below the bottom of the selection.

' Subtotal by company name
Range("A5", Range("A5").End(xlDown).End(xlToRight)).Select
Selection.Subtotal GroupBy:=1, Function:=xlSum, TotalList:=Array(5), _
Replace:=False, PageBreaks:=False, SummaryBelowData:=True
Range("A5", Range("A5").End(xlToRight).End(xlDown)).Select
Selection.Subtotal GroupBy:=2, Function:=xlSum, TotalList:=Array(5), _
Replace:=False, PageBreaks:=False, SummaryBelowData:=True

Any ideas that you can provide will be greatly appreciated.

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
I believe the rate function is broken in Excel 2003.... I can't verify this with other sources though williameis Excel Discussion (Misc queries) 3 February 27th 07 03:26 PM
Broken macro in Excel 2003 Debra Dalgleish Excel Programming 0 May 5th 05 12:59 PM
Broken macro in Excel 2003 Patrick Molloy[_2_] Excel Programming 0 May 5th 05 07:41 AM
upgrade to excel 2003 update broken links error tigger Links and Linking in Excel 0 December 1st 04 06:39 PM
Has my macro broken Excel? Alan[_27_] Excel Programming 3 October 29th 04 01:58 PM


All times are GMT +1. The time now is 10:36 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"