Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 64
Default subtotaling becomes slow

Hello,

I use the subtotal function freqeuntly in VB code. The first time I run the
code with this function it works very fast. However, the more I use this
macro, the slower and slower it gets. If I shut down Excel and restart, it
is fast again. It is a very simple macro with no variables to set or clear.
Is there anything I can do to prevent it from becoming slow (clear some cache
somewhere or something)?

Thanks

Below is the code:

Selection.Subtotal GroupBy:=2, Function:=xlSum, TotalList:=Array(3), _
Replace:=True, PageBreaks:=False, SummaryBelowData:=True


  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1,758
Default subtotaling becomes slow

When you see those dashed lines that show page breaks, then excel will think
that it has to figure out where they should be placed when you insert/delete
rows or columns.

I think I'd try this at the top of the code:

ActiveSheet.DisplayPageBreaks = False

Then your code.

If that doesn't help, maybe you could turn calculation to manual, add the
subtotals, then turn it back to automatic.

That could help, too.

nathan wrote:

Hello,

I use the subtotal function freqeuntly in VB code. The first time I run the
code with this function it works very fast. However, the more I use this
macro, the slower and slower it gets. If I shut down Excel and restart, it
is fast again. It is a very simple macro with no variables to set or clear.
Is there anything I can do to prevent it from becoming slow (clear some cache
somewhere or something)?

Thanks

Below is the code:

Selection.Subtotal GroupBy:=2, Function:=xlSum, TotalList:=Array(3), _
Replace:=True, PageBreaks:=False, SummaryBelowData:=True


--

Dave Peterson
  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 64
Default subtotaling becomes slow

Thanks for your response. That didn't seem to help. I already have the calc
turned off. Just seems to be some memory leak, wish there was a way to
retrieve it. This problem exists even when I do a manual subtotal from the
menu list data/subtotal. Removing the subtotal is just as slow... thanks
again.

"Dave Peterson" wrote:

When you see those dashed lines that show page breaks, then excel will think
that it has to figure out where they should be placed when you insert/delete
rows or columns.

I think I'd try this at the top of the code:

ActiveSheet.DisplayPageBreaks = False

Then your code.

If that doesn't help, maybe you could turn calculation to manual, add the
subtotals, then turn it back to automatic.

That could help, too.

nathan wrote:

Hello,

I use the subtotal function freqeuntly in VB code. The first time I run the
code with this function it works very fast. However, the more I use this
macro, the slower and slower it gets. If I shut down Excel and restart, it
is fast again. It is a very simple macro with no variables to set or clear.
Is there anything I can do to prevent it from becoming slow (clear some cache
somewhere or something)?

Thanks

Below is the code:

Selection.Subtotal GroupBy:=2, Function:=xlSum, TotalList:=Array(3), _
Replace:=True, PageBreaks:=False, SummaryBelowData:=True


--

Dave Peterson

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
Subtotaling Katie Excel Worksheet Functions 3 December 17th 09 10:04 PM
Subtotaling Katie Excel Worksheet Functions 1 December 11th 09 03:10 AM
Subtotaling falva Excel Worksheet Functions 0 February 20th 09 05:01 PM
Slow Excel Navigation with Up / Down Arrow and slow scrolling deddog Excel Discussion (Misc queries) 0 August 14th 07 09:56 PM
Slow Subtotaling Jeremy Excel Discussion (Misc queries) 1 January 3rd 05 04:59 PM


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