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: 2
Default Inexplicable difference in row hiding speed - identical code, identical machines!

I have some code which loops through a variety of cells determining
whether or not to hide them.

I don't think that the code is particularly inefficient (though by no
means perfect), but what is annoying me is that two machines which are
physically (i.e. processor, HDD, RAM) identical, running the same SP
of Excel 2000 on the same OS run at markedly different speeds. Both
machines are Compaq P4 machines, physically identical inside and out!

(XL 2000, ver 9.0.6926 SP3, Win2K)

The whole process on my "old" PC took about 20 seconds to run. The
whole process on my "new" PC takes closer to 5 minutes.

Is there anything "key" in the Tools, Options (or similar) setups that
might create this difference?

The code is below. I've commented out the references to
screenupdating and calculation modes as changing either / both of
these makes no discernable difference to the speed differential.

Just as a plain old user rightclicking and choosing to hide the
offending rows also exhibits the same turgid speed. Is there any
"dump" of Excel's settings that I can extract to see if there are any
differences?

Cheers!

Matt

Sub PrintAllDMDReports_pdf()
Dim CurCell As Range
Dim DMDCell As Range
Dim pdfLocation As String
Dim WeekNo As Integer

pdfLocation = Sheets("PDF Printing").Range("A11").Value
WeekNo = InputBox("Enter the current week no (e.g. 3)", "Week
Number")

'Loops through each DMD in the structure and prints
'Application.ScreenUpdating = False

For Each CurCell In Range(DMDRange)
SelectedDMD = CurCell.Value
Sheets("DMD Summary").Activate
Range("C2") = SelectedDMD
Range("D2").Activate
'Calculate

'Loops through to find #N/A's or other errors and hides them
'Has to be done this way to avoid problems for Excel 97 users as well
For Each DMDCell In Range("B6:B13,B22:B37")
N_A_DMD = DMDCell.Value
If IsError(N_A_DMD) Then
'ML Added
With Application
'.Calculation = xlManual
End With
If N_A_DMD = CVErr(xlErrNA) Then
DMDCell.Rows.Hidden = True
End If
'ML Added
With Application
'.Calculation = xlAutomatic
End With
End If
Next DMDCell

'Prints them to the pdf printer and renames to create unique files
Sheets("DMD Summary").PrintOut Copies:=1, Collate:=True
'dir (c:\documents and settings\
Name pdfLocation & "Week " & WeekNo & ".pdf" As "h:\DMDs\" &
SelectedDMD & ".pdf"
Range("B6:B13,B22:B37").Rows.Hidden = False
Next
'Application.ScreenUpdating = True
End Sub
 
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
Deleting Identical Entries SV Excel Worksheet Functions 2 December 12th 06 12:45 AM
Looking Up Datas when Key Values are Identical Frank Excel Worksheet Functions 3 November 2nd 06 03:06 AM
Why do I get different sums on identical columns. Stardust Excel Discussion (Misc queries) 1 May 5th 06 06:29 PM
Linking two identical charts Sarah Charts and Charting in Excel 1 January 31st 06 02:38 AM
two identical scripts, one with problem, the other with NO?! active_x[_8_] Excel Programming 0 November 5th 03 09:23 AM


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