ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Set Header and footer automatically (https://www.excelbanter.com/excel-programming/382458-set-header-footer-automatically.html)

Carpe Diem

Set Header and footer automatically
 
Hi,

I have about 15 sheets (from differente filles) and I would like to
set up the header and Footer just once , is it possible to make a code
in VBA to do this or a function in excelç ?

Can someone help me ?

Thanks in advance


Ricardo Galveia


Incidental

Set Header and footer automatically
 
hi

have a look at this site by chip pearson it should help you out, the
site has loads of other very helpful stuff on there well worth
checking out

http://www.cpearson.com/excel/headfoot.htm

hope it helps


rockhammer

Set Header and footer automatically
 
A couple of questions on how to take this a step further, if I may...

1) When I set up the headers/footers manually via
File-PageSetup-Header/Footer, I am able to make the header/footer into
multiple lines by pressing carriage return inside the text box. How can I do
the equivalent within macro code? Via some format code perhaps?

2) Is there a place somewhere that lists all the possible format codes that
can be used?

Thanks a lot.


"Incidental" wrote:

hi

have a look at this site by chip pearson it should help you out, the
site has loads of other very helpful stuff on there well worth
checking out

http://www.cpearson.com/excel/headfoot.htm

hope it helps



rockhammer

Set Header and footer automatically
 
Let me answer my own questions...

1)
http://exceltips.vitalnews.com/Pages...d_Footers.html

2) here are some
http://exceltips.vitalnews.com/Pages...ing_Codes.html
http://exceltips.vitalnews.com/Pages...ata_Codes.html

HOWEVER, if anyone can provide a more definitive/exhaustive list, it would
still be much appreciated.

Thanks.


"rockhammer" wrote:

A couple of questions on how to take this a step further, if I may...

1) When I set up the headers/footers manually via
File-PageSetup-Header/Footer, I am able to make the header/footer into
multiple lines by pressing carriage return inside the text box. How can I do
the equivalent within macro code? Via some format code perhaps?

2) Is there a place somewhere that lists all the possible format codes that
can be used?

Thanks a lot.


"Incidental" wrote:

hi

have a look at this site by chip pearson it should help you out, the
site has loads of other very helpful stuff on there well worth
checking out

http://www.cpearson.com/excel/headfoot.htm

hope it helps



rockhammer

Set Header and footer automatically
 
How might the code (sub workbook_beforeprint()) outlined in the referenced
website be modified such that it loops through only the worksheets in the
workbook that are selected instead of all the worksheets in the workbook?
Thanks.


"Incidental" wrote:

hi

have a look at this site by chip pearson it should help you out, the
site has loads of other very helpful stuff on there well worth
checking out

http://www.cpearson.com/excel/headfoot.htm

hope it helps



rockhammer

Set Header and footer automatically
 
A couple further quesitons on this code (sub workbook_beforeprint())...

1) If I were to select just two out of all the tabs (12) to file-print,
this code would loop through all tabs and then pop up the printing window
(where I choose printers, etc.). Through out all this time the two tabs that
I selected remain selected. However as soon as I click "ok" on the printing
window, the 2nd tab I selected get de-selected and only the first tab is
printed. Why is that and how can I make it print both/all selected tabs?

2) In (1) above, the looping through all the tabs is painfully slow - for
the 12 tabs it takes something like 2 minutes (I didn't actually time it) to
loop thru. Why might that be and how can I make it run faster? The file is
3.8MB which, in my mind, is not all that big. In fact, once a print or a
print preview is done, the entire workbook becomes very slow and can take
30sec to 1min for the screen to refresh when I scroll within a worksheet. I
am using excel 2003 11.8117.8122 sp2 and win xp pro sp2.

Any help would be appreciated.

"Incidental" wrote:

hi

have a look at this site by chip pearson it should help you out, the
site has loads of other very helpful stuff on there well worth
checking out

http://www.cpearson.com/excel/headfoot.htm

hope it helps




All times are GMT +1. The time now is 06:58 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
ExcelBanter.com