Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 9
Default Page Setup for multiple sheets

I need to set multiple worksheets with the same Page
setup. e.g. .25 borders, 1 page wide, 1 page tall, etc.
BUT looping through the sheets significantly slows down
the performace of my code. Is there a better way to
accomplish this?
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1,080
Default Page Setup for multiple sheets

Hi:

See this post by Tom Ogilvy, with a reference to John Green.

http://google.com/groups?selm=e2mdJn...FTNGP12&rnum=4

Regards,

Vasant.


"MDC" wrote in message
...
I need to set multiple worksheets with the same Page
setup. e.g. .25 borders, 1 page wide, 1 page tall, etc.
BUT looping through the sheets significantly slows down
the performace of my code. Is there a better way to
accomplish this?



  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 3
Default Page Setup for multiple sheets

A manual trick I heard about to get this done easily is
the following "recepy" :

1. Set up the page-setup as you need it on one of the tab
sheets
2. Select the tab sheet with the desired page-setup
3. With the control key pressed, select each of the other
tab sheets on which you want to apply the page-setup
4. Go to the page setup selection on the file menu
5. Click "OK" without changing anything

Result of these 5 steps : the page-setup defined in step
1 is copied over to all of the selected sheets.

I don''t know how to do a VBA routine without looping,
but this trick works and it works very fast ...
-----Original Message-----
Hi:

See this post by Tom Ogilvy, with a reference to John

Green.

http://google.com/groups?selm=e2mdJn40CHA.868%

40TK2MSFTNGP12&rnum=4

Regards,

Vasant.


"MDC" wrote in

message
...
I need to set multiple worksheets with the same Page
setup. e.g. .25 borders, 1 page wide, 1 page tall,

etc.
BUT looping through the sheets significantly slows down
the performace of my code. Is there a better way to
accomplish this?



.

  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27,285
Default Page Setup for multiple sheets

KeepItCool posted a VBA approach that uses that method by simulating
keystokes:


This is replicating the fastest manual way...

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



keepITcool

--
Regards,
Tom Ogilvy


philip wrote in message
...
A manual trick I heard about to get this done easily is
the following "recepy" :

1. Set up the page-setup as you need it on one of the tab
sheets
2. Select the tab sheet with the desired page-setup
3. With the control key pressed, select each of the other
tab sheets on which you want to apply the page-setup
4. Go to the page setup selection on the file menu
5. Click "OK" without changing anything

Result of these 5 steps : the page-setup defined in step
1 is copied over to all of the selected sheets.

I don''t know how to do a VBA routine without looping,
but this trick works and it works very fast ...
-----Original Message-----
Hi:

See this post by Tom Ogilvy, with a reference to John

Green.

http://google.com/groups?selm=e2mdJn40CHA.868%

40TK2MSFTNGP12&rnum=4

Regards,

Vasant.


"MDC" wrote in

message
...
I need to set multiple worksheets with the same Page
setup. e.g. .25 borders, 1 page wide, 1 page tall,

etc.
BUT looping through the sheets significantly slows down
the performace of my code. Is there a better way to
accomplish this?



.



  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 12
Default Page Setup for multiple sheets

Does anyone know how select all sheets in a workbook when
the number & names of sheets are not known?

I would like to have a macro that would put header/footer
on every worksheet in a workbook without having to loop
through each sheet - when I receive workbooks with 12-15
worksheets, looping through each sheet is a little slow.
Below is the code I'm currently using.

Sub AddHeader_Footer()
Dim ws As Object

For Each ws In Sheets
With ActiveSheet.PageSetup
.RightHeader = "Page &P of &N"
.LeftFooter = "&7&Z&F" & Chr(10) & "&A"
.RightFooter = "Printed: &D @ &T"
End With
Next ws
End Sub

Thanks, Kathryn

-----Original Message-----
KeepItCool posted a VBA approach that uses that method

by simulating
keystokes:


This is replicating the fastest manual way...

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



keepITcool

--
Regards,
Tom Ogilvy


philip wrote in

message
...
A manual trick I heard about to get this done easily is
the following "recepy" :

1. Set up the page-setup as you need it on one of the

tab
sheets
2. Select the tab sheet with the desired page-setup
3. With the control key pressed, select each of the

other
tab sheets on which you want to apply the page-setup
4. Go to the page setup selection on the file menu
5. Click "OK" without changing anything

Result of these 5 steps : the page-setup defined in

step
1 is copied over to all of the selected sheets.

I don''t know how to do a VBA routine without looping,
but this trick works and it works very fast ...
-----Original Message-----
Hi:

See this post by Tom Ogilvy, with a reference to John

Green.

http://google.com/groups?selm=e2mdJn40CHA.868%

40TK2MSFTNGP12&rnum=4

Regards,

Vasant.


"MDC" wrote in

message
...
I need to set multiple worksheets with the same Page
setup. e.g. .25 borders, 1 page wide, 1 page tall,

etc.
BUT looping through the sheets significantly slows

down
the performace of my code. Is there a better way to
accomplish this?


.



.



  #6   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 17
Default Page Setup for multiple sheets

Try using the Workbook_BeforePrint(Cancel As Boolean) event

HTH
-Merk


11/25/03 12:42PM

Does anyone know how select all sheets in a workbook when
the number & names of sheets are not known?

I would like to have a macro that would put header/footer
on every worksheet in a workbook without having to loop
through each sheet - when I receive workbooks with 12-15
worksheets, looping through each sheet is a little slow.
Below is the code I'm currently using.

Sub AddHeader_Footer()
Dim ws As Object

For Each ws In Sheets
With ActiveSheet.PageSetup
.RightHeader = "Page &P of &N"
.LeftFooter = "&7&Z&F" & Chr(10) & "&A"
.RightFooter = "Printed: &D @ &T"
End With
Next ws
End Sub

Thanks, Kathryn

-----Original Message-----
KeepItCool posted a VBA approach that uses that method

by simulating
keystokes:


This is replicating the fastest manual way...

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



keepITcool

--
Regards,
Tom Ogilvy


philip wrote in

message
...
A manual trick I heard about to get this done easily is
the following "recepy" :

1. Set up the page-setup as you need it on one of the

tab
sheets
2. Select the tab sheet with the desired page-setup
3. With the control key pressed, select each of the

other
tab sheets on which you want to apply the page-setup
4. Go to the page setup selection on the file menu
5. Click "OK" without changing anything

Result of these 5 steps : the page-setup defined in

step
1 is copied over to all of the selected sheets.

I don''t know how to do a VBA routine without looping,
but this trick works and it works very fast ...
-----Original Message-----
Hi:

See this post by Tom Ogilvy, with a reference to John

Green.

http://google.com/groups?selm=e2mdJn40CHA.868%

40TK2MSFTNGP12&rnum=4

Regards,

Vasant.


"MDC" wrote in

message
...
I need to set multiple worksheets with the same Page
setup. e.g. .25 borders, 1 page wide, 1 page tall,

etc.
BUT looping through the sheets significantly slows

down
the performace of my code. Is there a better way to
accomplish this?


.



.



Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

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


Similar Threads
Thread Thread Starter Forum Replies Last Post
How do I setup page and margins for ALL sheets in an EXCEL file AFTERWARDS? Claudia d'Amato Excel Discussion (Misc queries) 1 September 3rd 08 01:44 PM
setting page setup/print area for multiple sheets [email protected] Excel Discussion (Misc queries) 6 October 27th 07 01:19 PM
Printer Setup For Multiple sheets Ed Davis Excel Worksheet Functions 1 April 22nd 07 08:03 PM
Page Setup Across Multiple Worksheets Mike Excel Worksheet Functions 0 February 9th 06 06:31 PM
Page setup for multiple pages Lynn[_5_] Excel Programming 1 October 21st 03 05:28 PM


All times are GMT +1. The time now is 11:45 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"