LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.programming
RPW RPW is offline
external usenet poster
 
Posts: 52
Default Runs fast then slow

Hi everyone,

I have this code that runs very fast the first time I open the workbook and
run it. All subsequent runs are about 1/2 to 1/3 the speed. I don't
understand why the slow down. Can someone explain it to me?

Would I be better off taking the hide/unhide rows portion of it and making
it a function and include it as part of the cell formula - would that slow
the workbook way down?

Thanks in advance for your responses. Here's the code:

Dim RowCounter As Integer
Dim BreakCounter As Integer
Dim CellValue As String

Worksheets("Summary Sheet").Activate
Worksheets("Summary Sheet").Range("A1").Select

For RowCounter = 1 To 976
CellValue = Selection
If CellValue < "Skip" Then
Selection.EntireRow.Hidden = True
Selection.Offset(1, 0).Range("A1").Select
Else:
Selection.EntireRow.Hidden = False
Selection.Offset(1, 0).Range("A1").Select
End If
Next RowCounter

Worksheets("Summary Sheet").Range("p249").Select

For BreakCounter = 1 To 4
CellValue = Selection
If CellValue = "Break" Then
Selection.PageBreak = xlPageBreakManual
Else: Selection.PageBreak = xlPageBreakNone
End If
Selection.Offset(241, 0).Range("a1").Select
Next BreakCounter

ActiveSheet.PrintPreview

Worksheets("Summary Sheet").Range("a1:a1000").Select
Selection.EntireRow.Hidden = False
Worksheets("Basic Pricing").Activate
Worksheets("Basic Pricing").Range("d3").Select
--
rpw
 
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
Excel runs slow coco w. Excel Worksheet Functions 1 February 19th 10 06:50 AM
Macros Running Sometimes Slow Sometimes Fast bigV Excel Discussion (Misc queries) 0 June 9th 08 03:13 PM
Excel Runs Slow Jason Zischke Excel Discussion (Misc queries) 0 March 14th 07 02:19 AM
Searches slow for some Fast for others? [email protected] Excel Worksheet Functions 0 August 4th 05 08:54 PM
It was SLOW, now is FAST! Phillips Excel Programming 6 November 21st 03 10:21 PM


All times are GMT +1. The time now is 04:09 AM.

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"