LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Problem with Remove Subtotal in Macro

I built a macro using excel 97 that does a subtotal of a list of 100 - 5000
rows x 6 columns and later removes the subtotal. This macro took
approximately 15 to 30 seconds to run using excel 97 under a win 98
platform. We finally upgraded to win xp and excel 2002. As soon as the
macro runs the line "Selection.RemoveSubtotal", the whole thing reduces to a
crawl and I end up having to blow off excel or it will sit for over 1/2
hour.

I tried to run the macro to the point where the problem line exists and then
do the remove subtotal manually but I receive the same result.

Can you see any reason for this problem?

Thanks,

Jerry

Here's part of the macro:

Selection.SUBTOTAL GroupBy:=3, Function:=xlCount, TotalList:=Array(3,5),
_
Replace:=True, PageBreaks:=False, SummaryBelowData:=True
Columns("G:H").Select
Selection.ClearContents
Range("G2").Select
ActiveCell.FormulaR1C1 = "=IF(RC[-2]=RC[-4],""X"","""")"
Range("H2").Select
ActiveCell.FormulaR1C1 = "=R[1]C[-1]"
Range("B2").Select
Selection.End(xlDown).Select
ActiveCell.Offset(0, 5).Range("A1").Select
ActiveCell.FormulaR1C1 = "x"
ActiveCell.Offset(0, 1).Range("A1").Select
ActiveCell.FormulaR1C1 = "x"
Range("G2:H2").Select
Selection.Copy
Range(ActiveCell, ActiveCell.End(xlDown)).Select
ActiveSheet.Paste
Application.CutCopyMode = False
Selection.Copy
Selection.PasteSpecial Paste:=xlValues, Operation:=xlNone, SkipBlanks:=
_
False, Transpose:=False
Application.CutCopyMode = False
Range("A2").Select
Selection.RemoveSubtotal



 
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
sort macro, subtotal and add lines after subtotal David Excel Discussion (Misc queries) 1 August 29th 09 10:56 AM
How do I remove ##### from subtotal and total rows Coveyset Excel Discussion (Misc queries) 4 January 27th 09 11:07 PM
macro excel subtotal in subtotal GBO Excel Discussion (Misc queries) 2 November 29th 07 02:15 PM
Remove Subtotal In Macro Not Working Jerry Cropanese New Users to Excel 0 June 27th 05 05:13 AM
Remove subtotal where only one item Biff[_2_] Excel Programming 2 March 1st 05 02:51 PM


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