View Single Post
  #1   Report Post  
Posted to microsoft.public.excel.programming
John[_74_] John[_74_] is offline
external usenet poster
 
Posts: 1
Default VBA 'PageSetup' performance

I have a macro that creates some worksheets, then goes through them and sets
Page properties (landscape, margins...) like this:

With ActiveSheet.PageSetup
.Columns.AutoFit
.LeftHeader = ""
.CenterHeader = ""
.RightHeader = ""
...etc..
End With

Performance is TERRIBLE when these statements run. The rest of my macro
only a couple of seconds to complete, but the statements maniuplating the
properties for the PageSetup object run incredibly slow. What makes it
worse, I need to perform the maniuplations on each of the worksheets I
create, exponentially making the problem worse.

Is there another way to do this? Anyone know why its so darned slow? Any
ideas greatly appreciated.

J