![]() |
Subtotal command behaves differently 97 - 2003
I've had an Excel workbook given to me to examine because it fails to work as expected when converted from Excel 97 to Excel 2003. There is no run time error or any such problem. What I have identified is that the subtotal command behaves differently in 97 to what it does in 2003. The code in the program selects a range of ~648 rows which it then sorts desc on Column "I". Column "I" contains blank values from row 152 downward when the statement; Selection.subtotal .... executes. In 97, after this execution, 2 subtotal lines are inserted. One at line 152 in the middle of the selection displaying a total for the lines above it (NOTE: Cell I:152 now contains the value of I:151 followed by the " Totals"), and one at line 650 for all lines in the selection (649 is left blank for reasons I am not aware of). In 2003 however, the two lines are inserted at line 649 and 650 both displaying the same values. In 97 it appears that the execution is interpretting where the end of the dataset is by finding where cells become blank in Column "I" and inserts a total line immediately thereafter (Row 152). Whereas 2003 pays no attention to this factor whatsoever and totals the entire selection as is dictated by the code. This workbook has since been passed through a proprietary 'converter' which has no effect whatsoever. Because Excel uses thesame format for 97 and 2003 I can run the converted file on both versions however I am experiencing precisely the same results. I haven't been able to uncover any documentation of this issue anywhere via google so I'm wondering if anyone can provide any answers. I have essentially concluded that it is a but and that I will end up having to code around it but given the nature of my current project, I half expect to experience this again so wouldlike to know if code changes are my only option. Regs, Mr. Smith |
BUMP - Please help
Mr. Smith |
All times are GMT +1. The time now is 07:04 AM. |
Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com