View Single Post
  #10   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

This is pretty cool ... and it even seems to work!

Is there anyway to keep the File | Page Setup dialog flashing on the screen?

Thanks!

josh




"Tom Ogilvy" wrote in message
...
for Code, KeepItCool post this method. Format a sheet. Group all the
sheets making it the first sheet in the group. The use sendkeys:

' sheet3 is the pre-formatted sheet
sheets(array("sheet2","sheet3","sheet4")).select
sheets("sheet3").activate
SendKeys "{enter}"
Application.Dialogs(xlDialogPageSetup).Show

keepITcool

As I recall, this doesn't do every setting, but most of the more common
ones.

--
Regards,
Tom Ogilvy



"Tom Ogilvy" wrote in message
...
Set it for one sheet, then copy that sheet instead of adding sheets.

Also lookin xl help for

templates
customizing workbook defaults

also
Create a sheet template for new worksheets


See Sheet.xlt

If you create a single sheet workbook and name it sheet.xlt (after you
format it the way you want), then save it in the xlStart directory, then
insert = WorkSheet

--
Regards,
Tom Ogilvy

"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