Home |
Search |
Today's Posts |
#1
![]() |
|||
|
|||
![]()
I would like to know how to insert the contents of a particular cell (in each
worksheet) into the header/footer for the corresponding worksheet. |
#2
![]() |
|||
|
|||
![]()
Private Sub Workbook_BeforePrint(Cancel As Boolean)
With ActiveSheet.PageSetup .LeftFooter = Range("A1").Value End With End Sub 'This is workbook event code. 'To input this code, right click on the Excel icon on the worksheet '(or next to the File menu if you maximise your workbooks), 'select View Code from the menu, and paste the code -- HTH Bob Phillips "joeeng" wrote in message ... I would like to know how to insert the contents of a particular cell (in each worksheet) into the header/footer for the corresponding worksheet. |
#3
![]() |
|||
|
|||
![]()
I would like this routine to work for all worksheets in the workbook when the
"print entire workbook" selection is made. The routine below only does the first worksheet footer when I print the entire workbook. "Bob Phillips" wrote: Private Sub Workbook_BeforePrint(Cancel As Boolean) With ActiveSheet.PageSetup .LeftFooter = Range("A1").Value End With End Sub 'This is workbook event code. 'To input this code, right click on the Excel icon on the worksheet '(or next to the File menu if you maximise your workbooks), 'select View Code from the menu, and paste the code -- HTH Bob Phillips "joeeng" wrote in message ... I would like to know how to insert the contents of a particular cell (in each worksheet) into the header/footer for the corresponding worksheet. |
#4
![]() |
|||
|
|||
![]()
You can loop through the sheets
Private Sub Workbook_BeforePrint(Cancel As Boolean) Dim wkSht As Worksheet For Each wkSht In ThisWorkbook.Worksheets wkSht.PageSetup.LeftFooter = wkSht.Range("A1").Value Next wkSht End Sub -- Regards Ron de Bruin http://www.rondebruin.nl "joeeng" wrote in message ... I would like this routine to work for all worksheets in the workbook when the "print entire workbook" selection is made. The routine below only does the first worksheet footer when I print the entire workbook. "Bob Phillips" wrote: Private Sub Workbook_BeforePrint(Cancel As Boolean) With ActiveSheet.PageSetup .LeftFooter = Range("A1").Value End With End Sub 'This is workbook event code. 'To input this code, right click on the Excel icon on the worksheet '(or next to the File menu if you maximise your workbooks), 'select View Code from the menu, and paste the code -- HTH Bob Phillips "joeeng" wrote in message ... I would like to know how to insert the contents of a particular cell (in each worksheet) into the header/footer for the corresponding worksheet. |
#5
![]() |
|||
|
|||
![]()
Thanks, that works.
"Ron de Bruin" wrote: You can loop through the sheets Private Sub Workbook_BeforePrint(Cancel As Boolean) Dim wkSht As Worksheet For Each wkSht In ThisWorkbook.Worksheets wkSht.PageSetup.LeftFooter = wkSht.Range("A1").Value Next wkSht End Sub -- Regards Ron de Bruin http://www.rondebruin.nl "joeeng" wrote in message ... I would like this routine to work for all worksheets in the workbook when the "print entire workbook" selection is made. The routine below only does the first worksheet footer when I print the entire workbook. "Bob Phillips" wrote: Private Sub Workbook_BeforePrint(Cancel As Boolean) With ActiveSheet.PageSetup .LeftFooter = Range("A1").Value End With End Sub 'This is workbook event code. 'To input this code, right click on the Excel icon on the worksheet '(or next to the File menu if you maximise your workbooks), 'select View Code from the menu, and paste the code -- HTH Bob Phillips "joeeng" wrote in message ... I would like to know how to insert the contents of a particular cell (in each worksheet) into the header/footer for the corresponding worksheet. |
#6
![]() |
|||
|
|||
![]()
Can I change the font characteristics in this routine?
"Ron de Bruin" wrote: You can loop through the sheets Private Sub Workbook_BeforePrint(Cancel As Boolean) Dim wkSht As Worksheet For Each wkSht In ThisWorkbook.Worksheets wkSht.PageSetup.LeftFooter = wkSht.Range("A1").Value Next wkSht End Sub -- Regards Ron de Bruin http://www.rondebruin.nl "joeeng" wrote in message ... I would like this routine to work for all worksheets in the workbook when the "print entire workbook" selection is made. The routine below only does the first worksheet footer when I print the entire workbook. "Bob Phillips" wrote: Private Sub Workbook_BeforePrint(Cancel As Boolean) With ActiveSheet.PageSetup .LeftFooter = Range("A1").Value End With End Sub 'This is workbook event code. 'To input this code, right click on the Excel icon on the worksheet '(or next to the File menu if you maximise your workbooks), 'select View Code from the menu, and paste the code -- HTH Bob Phillips "joeeng" wrote in message ... I would like to know how to insert the contents of a particular cell (in each worksheet) into the header/footer for the corresponding worksheet. |
#7
![]() |
|||
|
|||
![]()
Yes
See how I use the font size here http://www.rondebruin.nl/print.htm#Saved Check out the VBA help for all formatting codes. Look for "Formatting Codes for Headers and Footers" You can use something like this : .CenterFooter = "&8Page &P & of &N" .RightFooter = "&8Last Saved : &B" & ActiveWorkbook.BuiltinDocumentProperties("Last Save Time") .LeftFooter = "&8" & ActiveWorkbook.FullName & Chr(10) & "Sheetname : &B" & ActiveSheet.Name -- Regards Ron de Bruin http://www.rondebruin.nl "joeeng" wrote in message ... Can I change the font characteristics in this routine? "Ron de Bruin" wrote: You can loop through the sheets Private Sub Workbook_BeforePrint(Cancel As Boolean) Dim wkSht As Worksheet For Each wkSht In ThisWorkbook.Worksheets wkSht.PageSetup.LeftFooter = wkSht.Range("A1").Value Next wkSht End Sub -- Regards Ron de Bruin http://www.rondebruin.nl "joeeng" wrote in message ... I would like this routine to work for all worksheets in the workbook when the "print entire workbook" selection is made. The routine below only does the first worksheet footer when I print the entire workbook. "Bob Phillips" wrote: Private Sub Workbook_BeforePrint(Cancel As Boolean) With ActiveSheet.PageSetup .LeftFooter = Range("A1").Value End With End Sub 'This is workbook event code. 'To input this code, right click on the Excel icon on the worksheet '(or next to the File menu if you maximise your workbooks), 'select View Code from the menu, and paste the code -- HTH Bob Phillips "joeeng" wrote in message ... I would like to know how to insert the contents of a particular cell (in each worksheet) into the header/footer for the corresponding worksheet. |
#8
![]() |
|||
|
|||
![]()
Thanks, that worked.
"Ron de Bruin" wrote: Yes See how I use the font size here http://www.rondebruin.nl/print.htm#Saved Check out the VBA help for all formatting codes. Look for "Formatting Codes for Headers and Footers" You can use something like this : .CenterFooter = "&8Page &P & of &N" .RightFooter = "&8Last Saved : &B" & ActiveWorkbook.BuiltinDocumentProperties("Last Save Time") .LeftFooter = "&8" & ActiveWorkbook.FullName & Chr(10) & "Sheetname : &B" & ActiveSheet.Name -- Regards Ron de Bruin http://www.rondebruin.nl "joeeng" wrote in message ... Can I change the font characteristics in this routine? "Ron de Bruin" wrote: You can loop through the sheets Private Sub Workbook_BeforePrint(Cancel As Boolean) Dim wkSht As Worksheet For Each wkSht In ThisWorkbook.Worksheets wkSht.PageSetup.LeftFooter = wkSht.Range("A1").Value Next wkSht End Sub -- Regards Ron de Bruin http://www.rondebruin.nl "joeeng" wrote in message ... I would like this routine to work for all worksheets in the workbook when the "print entire workbook" selection is made. The routine below only does the first worksheet footer when I print the entire workbook. "Bob Phillips" wrote: Private Sub Workbook_BeforePrint(Cancel As Boolean) With ActiveSheet.PageSetup .LeftFooter = Range("A1").Value End With End Sub 'This is workbook event code. 'To input this code, right click on the Excel icon on the worksheet '(or next to the File menu if you maximise your workbooks), 'select View Code from the menu, and paste the code -- HTH Bob Phillips "joeeng" wrote in message ... I would like to know how to insert the contents of a particular cell (in each worksheet) into the header/footer for the corresponding worksheet. |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Using contents of a cell in a formula | Excel Discussion (Misc queries) | |||
Possible Lookup Table | Excel Worksheet Functions | |||
hide cell contents and make it reappear (Excel) | Excel Discussion (Misc queries) | |||
Challenging Charting | Charts and Charting in Excel | |||
GET.CELL | Excel Worksheet Functions |