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


Hello, has anyone come across this problem before..

I have some code which looks in each cell and hides the row if it meets
a certain criteria. If i run the code it works instantaneously but after
printing the worksheet (or print previewing it) the code takes ages.

Is there an obvious reason for this?

Thanks

John


--
johncassell
------------------------------------------------------------------------
johncassell's Profile: http://www.excelforum.com/member.php...o&userid=25016
View this thread: http://www.excelforum.com/showthread...hreadid=513682

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 5,302
Default macro slow after printing

Hi John,

It is likely that the hiding of rows is causing Excel repeatedly to
recalculate the position of pagebreaks, which can be very slow.

Try wapping your code something like:

On Error GoTo XIT

With Application
CalcMode = .Calculation
.Calculation = xlCalculationManual
.ScreenUpdating = False
End With

With ActiveWindow
ViewMode = .View
.View = xlNormalView
End With

SH.DisplayPageBreaks = False


'YOUR CODE '<<====


XIT:
With Application
.Calculation = CalcMode
.ScreenUpdating = True
End With

ActiveWindow.View = ViewMode

End Sub


---
Regards,
Norman



"johncassell"
wrote in message
...

Hello, has anyone come across this problem before..

I have some code which looks in each cell and hides the row if it meets
a certain criteria. If i run the code it works instantaneously but after
printing the worksheet (or print previewing it) the code takes ages.

Is there an obvious reason for this?

Thanks

John


--
johncassell
------------------------------------------------------------------------
johncassell's Profile:
http://www.excelforum.com/member.php...o&userid=25016
View this thread: http://www.excelforum.com/showthread...hreadid=513682



  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default macro slow after printing


Cheers Norman, I wrapped my code but it made my code not work at all!

I simply cut sh.DisplayPageBreaks = False from your code and put it at
the top of mine which worked perfectly.

Thanks very much.

John


--
johncassell
------------------------------------------------------------------------
johncassell's Profile: http://www.excelforum.com/member.php...o&userid=25016
View this thread: http://www.excelforum.com/showthread...hreadid=513682

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
Worksheet slow after printing jm100 New Users to Excel 1 May 15th 07 01:49 AM
PDF Printing from Excel 2007 -- very slow Philip Trick Excel Discussion (Misc queries) 2 April 16th 07 06:28 PM
Printing is slow: Any suggestions Bob Excel Discussion (Misc queries) 3 July 22nd 05 02:14 PM
Slow printing from Excel 2003 VBA Paul Christie[_2_] Excel Programming 0 September 16th 04 04:39 PM
Printing Slow Down On VB Repetitive Use Dick Kusleika[_3_] Excel Programming 2 April 28th 04 10:47 PM


All times are GMT +1. The time now is 12:51 AM.

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"