Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
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
Posted to microsoft.public.excel.programming
|
|||
|
|||
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
Posted to microsoft.public.excel.programming
|
|||
|
|||
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 |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
I believe the rate function is broken in Excel 2003.... I can't verify this with other sources though | Excel Discussion (Misc queries) | |||
Broken macro in Excel 2003 | Excel Programming | |||
Broken macro in Excel 2003 | Excel Programming | |||
upgrade to excel 2003 update broken links error | Links and Linking in Excel | |||
Has my macro broken Excel? | Excel Programming |