View Single Post
  #6   Report Post  
Posted to microsoft.public.excel.programming
Josh Sale Josh Sale is offline
external usenet poster
 
Posts: 177
Default Setting PageSetup Properties in Multiple Worksheets

Thanks Jim.

I was aware of your suggestions and have already implemented suggestions 1 -
3. I've not taken the step of doing the pagesetup in XL4 but I just might
need to.

Thanks again,

josh




"Jim Cone" wrote in message
...
Hello Josh,

Get yourself a test workbook with about 50 or more sheets in it,
select all the sheets and then add some header/footer info.
My experience has been that Excel acts like a snake trying
to swallow a goat when doing this.
It wouldn't be any better using code.

Do one sheet at a time but to reduce the time required...
1. Only change/add those properties you require.
2. Do not leave or have other lines in the code that refer to pagesetup
properties.
3. Set displaypagebreaks to false at the start of your code.
4. If you have quite a bit of extra time, look at converting your
pagesetup code
to XL4 macro code. It is slightly faster. John Green has a almost
complete example here...
(01/22/2001, "About PageSetup", Excel.programming)
http://makeashorterlink.com/?Q606527BC

Regards,
Jim Cone
San Francisco, USA
http://www.realezsites.com/bus/primitivesoftware



"Josh Sale" <jsale@tril dot cod wrote in message
...
Right now my VBA code creates a number of worksheets and then sets a bunch
of their PageSetup properties.
Because PageSetup can be so slow, I would like to set all of the
properties
at once. I tried:
With Sheets(Array("Sheet2", "Sheet1")).PageSetup
.LeftHeader = "foo"
End With

But I get a run-time error on the With statement (438 Object doesn't
support
this property or method).
Is there some other way to accomplish this or to dynamically (and
temporarily) define what the default PageSetup properties should be for
newly added worksheets?
TIA,
josh