LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #6   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 340
Default VBA Page Setup/Formatting EXTREMELY Slow... Help!

Mike, one way to greatly speed up changing page setup is to first check the
property being changed and only change the properties that need changing.
Checking a property is far, far faster than setting it.

Bob Flanagan
Macro Systems
144 Dewberry Drive
Hockessin, Delaware, U.S. 19707

Phone: 302-234-9857, cell 302-584-1771
http://www.add-ins.com
Productivity add-ins and downloadable books on VB macros for Excel

"MikeZz" wrote in message
...
I have a sub that disables screen updating before it calls this routine.

Unfortunately, this colde still runs extremely show.
I can create and format 10 sheets including multiple pivot tables in a
fraction of time that it takes just to add simple headers and footers to
the
same 10 sheets.

Am I doing something wrong?
Thanks!

Sub Setup_All_Headers()
Dim wb As Workbook
Dim sh As Sheets
Dim c, s

Set wb = ActiveWorkbook
c = Worksheets.Count

For s = 1 To c
Worksheets(s).Activate
With ActiveSheet.PageSetup
.PrintTitleRows = "$1:$1"
End With
ActiveSheet.PageSetup.PrintArea = ""
With ActiveSheet.PageSetup
.CenterHeader = "&""Arial,Bold""&20&A&""Arial,Regular""&14" &
Chr(10) & "&F"
.CenterFooter = "Page &P of &N"
.RightFooter = "&D" & Chr(10) & "&T"
.PrintGridlines = True
.CenterHorizontally = True
.CenterVertically = False
.Orientation = xlPortrait
.Zoom = False
.FitToPagesWide = 1
.FitToPagesTall = 3
End With
Next

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
EXcel 2003 Page setup slow Ian Excel Discussion (Misc queries) 5 April 22nd 10 12:48 PM
Page Setup Macro runs slow William G Excel Discussion (Misc queries) 3 March 31st 09 07:31 PM
Page Setup SLOW trying excel 4..... [email protected] New Users to Excel 0 February 20th 08 10:54 PM
Page Setup functions very slow in VBA earlier thread Jeff[_44_] Excel Programming 1 January 3rd 05 11:12 PM
Excell 2003 Page Setup Slow JT Lovell Excel Programming 6 September 17th 04 02:39 AM


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