Copying Page SetUp

R

Robin Clay

Greetings !

How do I copy the Page SetUp from one Worksheet to
another ?

I do NOT want to copy it to all sheets.

I'm sure it's a very simple thing, something like

Worksheets(7).PageSetUp = Worksheets(1).PageSetUp
RunTime Error 438:
Object doesn't support this property or method

I also want to copy the Header & Footer -
would they be included?

RClay AT haswell DOT com
 
D

Don Guillett

try this for the setups you want

Sub copysetup()
With ActiveSheet.PageSetup
..Orientation = Sheets("sheet7").PageSetup.Orientation
End With
End Sub
 
R

Robin Clay

Erm... Thanks, but... it didn't like the double dots, so I
deleted one of them.

And it didn't copy the entire layout - the orientation
remains the same - they were both landscape, anyway.

Is there a "blanket" command that will copy everything, or
do I really have to copy every single individual item in
turn ?
 
D

Don Guillett

First, I did NOT send with double dots. Don't know why that happens.

AFAIK you must do this for each part of the page setup that you want to
copy.
Suggest you only use the setup changes needed.
The landscape I gave was an EXAMPLE of how to do it.
 
T

Tom Ogilvy

Yes, you have to copy each setting (unless you copy the sheet itself).

Don didn't put in double dots. Some mail software puts in a dot if there is
a dot on the left margin. Otherwise the single dot is interpreted as a
formatting command.
 
K

keepitcool

This is replicating the fastest manual way...

sheets(array("sheet2","sheet3","sheet4")).select
sheets("sheet3").activate
SendKeys "{enter}"
Application.Dialogs(xlDialogPageSetup).Show



keepITcool

< email : keepitcool chello nl (with @ and .) >
< homepage: http://members.chello.nl/keepitcool >
 
T

Tom Ogilvy

It is a good suggestion and I am familiar with doing it manually - however,
not perfect.

Print title rows and print title columns and printarea were not transferred.
Most attributes were.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top