PC Review


Reply
Thread Tools Rate Thread

Applying a specific Print setting to all worksheets

 
 
vicky
Guest
Posts: n/a
 
      11th Nov 2009
i have a form which displays the list of all worksheets of its
corresponding workbook... so when i select say for example 1st
worksheet from tat list print setting of the selected sheet should be
applied to all the sheets of tat workbook..... it sounds complex .....
but hope anyone can provide me code snippet for this... or macro to
configure the print setting(like page setup,zoom,margin) and then
applying for all sheets .....
 
Reply With Quote
 
 
 
 
Dave Peterson
Guest
Posts: n/a
 
      11th Nov 2009
Record a macro when you change a print setting for any of those sheets.

Delete the settings that you don't care about (it'll speed up the code).

Then you could use:

Dim MstrWks as worksheet
dim wks as worksheet

'me.combobox1 contains the worksheet name
set mstrwks = nothing
on error resume next
set mstrwks = activeworkbook.worksheets(me.combobox1.value)
on error goto 0

if mstrwks is nothing then
'nothing chosen (yet)
exit sub???
end if

for each wks in activeworkbook.worksheets
if wks.name = mstrwks.name then
'skip it
else
'do all the work you want.
with wks.PageSetup
.LeftHeader = mstrwks.pagesetup.leftheader
.centerHeader = mstrwks.pagesetup.centerheader
'and on and on...
end with
end if
next wks

There isn't a way to get all those properties as one object.

(untested, uncompiled. Watch for typos.)



vicky wrote:
>
> i have a form which displays the list of all worksheets of its
> corresponding workbook... so when i select say for example 1st
> worksheet from tat list print setting of the selected sheet should be
> applied to all the sheets of tat workbook..... it sounds complex .....
> but hope anyone can provide me code snippet for this... or macro to
> configure the print setting(like page setup,zoom,margin) and then
> applying for all sheets .....


--

Dave Peterson
 
Reply With Quote
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Can you print specific worksheets? Rodney Microsoft Excel Discussion 2 26th Dec 2007 07:41 PM
print specific worksheets in specific order. jarvo Microsoft Excel Programming 1 11th Apr 2006 11:05 AM
How to print specific worksheets Susan Hayes Microsoft Excel Programming 2 8th Jan 2006 11:36 PM
Re: How do create/print a report using specific protected worksheets? Frank Kabel Microsoft Excel Misc 0 9th Sep 2004 08:58 PM
Setting Print Titles on multiple worksheets Judd Starr Microsoft Excel Worksheet Functions 1 11th Mar 2004 10:17 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 01:20 PM.