Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 34
Default Slow Macro - Formatting Macro

Hello,

The macro below works, but runs very slowly when I am running it on about
190 different worksheets all within the same workbook. Is there a way to
speed up the macro? It took ten minutes and did about 90 files.

Thanks in advance.

Sub PrintTitleColumns2()

Dim ws As Worksheet

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

For Each ws In Worksheets
With ws.PageSetup
.PrintTitleRows = "$1:$1"
.PrintTitleColumns = "$I:$I"
.Orientation = xlLandscape
.PaperSize = xlPaperLegal
.LeftMargin = Application.InchesToPoints(0.25)
.RightMargin = Application.InchesToPoints(0.25)
.TopMargin = Application.InchesToPoints(1)
.BottomMargin = Application.InchesToPoints(1)
.HeaderMargin = Application.InchesToPoints(0.5)
.FooterMargin = Application.InchesToPoints(0.5)
.FitToPagesWide = 2
.FitToPagesTall = False
.Zoom = False
.Order = xlOverThenDown
End With

Next ws

With Application
.ScreenUpdating = True
.Calculation = CalcMode
End With
End Sub
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1,069
Default Slow Macro - Formatting Macro

Before running your macro, change your default printer to "Microsoft Office
Document Image Writer". It should run much faster.

Hope this helps,

Hutch

"ScottMsp" wrote:

Hello,

The macro below works, but runs very slowly when I am running it on about
190 different worksheets all within the same workbook. Is there a way to
speed up the macro? It took ten minutes and did about 90 files.

Thanks in advance.

Sub PrintTitleColumns2()

Dim ws As Worksheet

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

For Each ws In Worksheets
With ws.PageSetup
.PrintTitleRows = "$1:$1"
.PrintTitleColumns = "$I:$I"
.Orientation = xlLandscape
.PaperSize = xlPaperLegal
.LeftMargin = Application.InchesToPoints(0.25)
.RightMargin = Application.InchesToPoints(0.25)
.TopMargin = Application.InchesToPoints(1)
.BottomMargin = Application.InchesToPoints(1)
.HeaderMargin = Application.InchesToPoints(0.5)
.FooterMargin = Application.InchesToPoints(0.5)
.FitToPagesWide = 2
.FitToPagesTall = False
.Zoom = False
.Order = xlOverThenDown
End With

Next ws

With Application
.ScreenUpdating = True
.Calculation = CalcMode
End With
End Sub

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
Help with slow Macro Dooza Excel Programming 15 October 30th 08 02:26 PM
Macro is very slow jlclyde Excel Discussion (Misc queries) 2 September 29th 08 04:43 PM
slow macro John_A[_2_] Excel Programming 3 March 6th 07 06:36 PM
Macro slow down Jonny Excel Programming 3 February 24th 05 01:29 AM
Macro it's very Slow .... leo_nunez[_2_] Excel Programming 4 August 28th 04 03:45 PM


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