Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
pagesetup object
I believe that I should be able to "pass" the parameter settings of one
pagesetup on a worksheet to another and thus having the same headers, footers, margins, print areas and such without having to declare each setting.... private sub setupworksheetprintarea() dim w as worksheet dim wkb as workbook dim pg as pagesetup set w = thisworkbook.activesheet set wkb = workbooks.add set wkb.activesheet.pagesetup = w.pagesetup end sub I am only speculating but I think it should work... |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
pagesetup object
It sure would be nice if it did. But I betting it didn't work when you tried
it, huh? Steven Cheng wrote: I believe that I should be able to "pass" the parameter settings of one pagesetup on a worksheet to another and thus having the same headers, footers, margins, print areas and such without having to declare each setting.... private sub setupworksheetprintarea() dim w as worksheet dim wkb as workbook dim pg as pagesetup set w = thisworkbook.activesheet set wkb = workbooks.add set wkb.activesheet.pagesetup = w.pagesetup end sub I am only speculating but I think it should work... -- Dave Peterson |
#3
Posted to microsoft.public.excel.programming
|
|||
|
|||
pagesetup object
nope...not a chance...ugh....
"Dave Peterson" wrote: It sure would be nice if it did. But I betting it didn't work when you tried it, huh? Steven Cheng wrote: I believe that I should be able to "pass" the parameter settings of one pagesetup on a worksheet to another and thus having the same headers, footers, margins, print areas and such without having to declare each setting.... private sub setupworksheetprintarea() dim w as worksheet dim wkb as workbook dim pg as pagesetup set w = thisworkbook.activesheet set wkb = workbooks.add set wkb.activesheet.pagesetup = w.pagesetup end sub I am only speculating but I think it should work... -- Dave Peterson |
#4
Posted to microsoft.public.excel.programming
|
|||
|
|||
pagesetup object
Steven,
As Dave says, it won't work. See the help for the PageSetUp property: <Help Returns a PageSetup object that contains all the page setup settings for the specified object. Read-only. </Help Note the Read-Only. so: Private Sub CommandButton2_Click() Dim PSetUp As PageSetup 'This works Set PSetUp = ThisWorkbook.Worksheets(1).PageSetup 'This fails Set ThisWorkbook.Worksheets(2).PageSetup = PSetUp End Sub NickHK "Steven Cheng" wrote in message ... I believe that I should be able to "pass" the parameter settings of one pagesetup on a worksheet to another and thus having the same headers, footers, margins, print areas and such without having to declare each setting.... private sub setupworksheetprintarea() dim w as worksheet dim wkb as workbook dim pg as pagesetup set w = thisworkbook.activesheet set wkb = workbooks.add set wkb.activesheet.pagesetup = w.pagesetup end sub I am only speculating but I think it should work... |
#5
Posted to microsoft.public.excel.programming
|
|||
|
|||
pagesetup object
There are a lot of settings that get transfered when you select multiple sheets
(have to be in the same workbook, though), then go into file|page setup and click ok. And the page setup stuff can really slow down your macro. Keep just the settings you want to change. Tom Ogilvy combined some tips from John Green and keepitcool in this post: http://groups.google.co.uk/group/mic...9 b26c2cb850e or http://snipurl.com/1cfe3 Steven Cheng wrote: nope...not a chance...ugh.... "Dave Peterson" wrote: It sure would be nice if it did. But I betting it didn't work when you tried it, huh? Steven Cheng wrote: I believe that I should be able to "pass" the parameter settings of one pagesetup on a worksheet to another and thus having the same headers, footers, margins, print areas and such without having to declare each setting.... private sub setupworksheetprintarea() dim w as worksheet dim wkb as workbook dim pg as pagesetup set w = thisworkbook.activesheet set wkb = workbooks.add set wkb.activesheet.pagesetup = w.pagesetup end sub I am only speculating but I think it should work... -- Dave Peterson -- Dave Peterson |
#6
Posted to microsoft.public.excel.programming
|
|||
|
|||
pagesetup object
The code that Tom included from John Green uses xl4 macros and can be much
faster. Dave Peterson wrote: There are a lot of settings that get transfered when you select multiple sheets (have to be in the same workbook, though), then go into file|page setup and click ok. And the page setup stuff can really slow down your macro. Keep just the settings you want to change. Tom Ogilvy combined some tips from John Green and keepitcool in this post: http://groups.google.co.uk/group/mic...9 b26c2cb850e or http://snipurl.com/1cfe3 Steven Cheng wrote: nope...not a chance...ugh.... "Dave Peterson" wrote: It sure would be nice if it did. But I betting it didn't work when you tried it, huh? Steven Cheng wrote: I believe that I should be able to "pass" the parameter settings of one pagesetup on a worksheet to another and thus having the same headers, footers, margins, print areas and such without having to declare each setting.... private sub setupworksheetprintarea() dim w as worksheet dim wkb as workbook dim pg as pagesetup set w = thisworkbook.activesheet set wkb = workbooks.add set wkb.activesheet.pagesetup = w.pagesetup end sub I am only speculating but I think it should work... -- Dave Peterson -- Dave Peterson -- Dave Peterson |
#7
Posted to microsoft.public.excel.programming
|
|||
|
|||
pagesetup object
thanks Dave. this little tidbit is pretty good.
"Dave Peterson" wrote: The code that Tom included from John Green uses xl4 macros and can be much faster. Dave Peterson wrote: There are a lot of settings that get transfered when you select multiple sheets (have to be in the same workbook, though), then go into file|page setup and click ok. And the page setup stuff can really slow down your macro. Keep just the settings you want to change. Tom Ogilvy combined some tips from John Green and keepitcool in this post: http://groups.google.co.uk/group/mic...9 b26c2cb850e or http://snipurl.com/1cfe3 Steven Cheng wrote: nope...not a chance...ugh.... "Dave Peterson" wrote: It sure would be nice if it did. But I betting it didn't work when you tried it, huh? Steven Cheng wrote: I believe that I should be able to "pass" the parameter settings of one pagesetup on a worksheet to another and thus having the same headers, footers, margins, print areas and such without having to declare each setting.... private sub setupworksheetprintarea() dim w as worksheet dim wkb as workbook dim pg as pagesetup set w = thisworkbook.activesheet set wkb = workbooks.add set wkb.activesheet.pagesetup = w.pagesetup end sub I am only speculating but I think it should work... -- Dave Peterson -- Dave Peterson -- Dave Peterson |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
PageSetup Class | Excel Programming | |||
Activesheet.pagesetup | Excel Programming | |||
PageSetup | Excel Discussion (Misc queries) | |||
PageSetup | Excel Programming | |||
PageSetup | Excel Programming |