Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.misc
|
|||
|
|||
![]()
Hi everyone,
Is it possible to use a cell reference in the custom header to pick up info in a cell in the worksheet? TIA -- Smudge |
#2
![]()
Posted to microsoft.public.excel.misc
|
|||
|
|||
![]()
hi
not sure exactly what you want but i use the following to copy the contents of a cell into the headers and footers Sub HeaderandFooter() Dim s As Integer For s = 1 To Worksheets.Count Worksheets(s).PageSetup.CenterFooter = "&""Arial""&7" & ThisWorkbook.Worksheets("sheet1").Range("E1").Valu e Worksheets(s).PageSetup.LeftHeader = "&""Arial""&7" & ThisWorkbook.Worksheets("sheet1").Range("B1").Valu e ' Worksheets(s).PageSetup.RightHeader = "&""Arial""&7" & ThisWorkbook.Worksheets("sheet1").Range("C1").Valu e Worksheets(s).PageSetup.LeftFooter = "&""Arial""&7" & ThisWorkbook.Worksheets("sheet1").Range("D1").Valu e Worksheets(s).PageSetup.RightFooter = "&""Arial""&7" & ThisWorkbook.Worksheets("sheet1").Range("C1").Valu e ' Worksheets(s).PageSetup.CenterHeader = "&""Arial""&7" & ThisWorkbook.Worksheets("sheet1").Range("F1").Valu e Next s End Sub Paste the code into a macro, type some data into the cells and test the results HTH kevin On 18 Oct, 11:50, Smudge wrote: Hi everyone, Is it possible to use a cell reference in the custom header to pick up info in a cell in the worksheet? TIA -- Smudge |
#3
![]()
Posted to microsoft.public.excel.misc
|
|||
|
|||
![]()
Sub CellInFooter()
With ActiveSheet .PageSetup.CenterFooter = .Range("A1").Value End With End Sub Gord Dibben MS Excel MVP On Thu, 18 Oct 2007 03:50:02 -0700, Smudge wrote: Hi everyone, Is it possible to use a cell reference in the custom header to pick up info in a cell in the worksheet? TIA |
#4
![]()
Posted to microsoft.public.excel.misc
|
|||
|
|||
![]()
Hi Kevcar,
Thanks for your reply but I'm obviously missing something as I can't get this to work. Was I supposed to give the workshhet a particular name? Cheers again -- Smudge "kevcar40" wrote: hi not sure exactly what you want but i use the following to copy the contents of a cell into the headers and footers Sub HeaderandFooter() Dim s As Integer For s = 1 To Worksheets.Count Worksheets(s).PageSetup.CenterFooter = "&""Arial""&7" & ThisWorkbook.Worksheets("sheet1").Range("E1").Valu e Worksheets(s).PageSetup.LeftHeader = "&""Arial""&7" & ThisWorkbook.Worksheets("sheet1").Range("B1").Valu e ' Worksheets(s).PageSetup.RightHeader = "&""Arial""&7" & ThisWorkbook.Worksheets("sheet1").Range("C1").Valu e Worksheets(s).PageSetup.LeftFooter = "&""Arial""&7" & ThisWorkbook.Worksheets("sheet1").Range("D1").Valu e Worksheets(s).PageSetup.RightFooter = "&""Arial""&7" & ThisWorkbook.Worksheets("sheet1").Range("C1").Valu e ' Worksheets(s).PageSetup.CenterHeader = "&""Arial""&7" & ThisWorkbook.Worksheets("sheet1").Range("F1").Valu e Next s End Sub Paste the code into a macro, type some data into the cells and test the results HTH kevin On 18 Oct, 11:50, Smudge wrote: Hi everyone, Is it possible to use a cell reference in the custom header to pick up info in a cell in the worksheet? TIA -- Smudge |
#5
![]()
Posted to microsoft.public.excel.misc
|
|||
|
|||
![]()
Thank you Gord
Cheers -- Smudge "Gord Dibben" wrote: Sub CellInFooter() With ActiveSheet .PageSetup.CenterFooter = .Range("A1").Value End With End Sub Gord Dibben MS Excel MVP On Thu, 18 Oct 2007 03:50:02 -0700, Smudge wrote: Hi everyone, Is it possible to use a cell reference in the custom header to pick up info in a cell in the worksheet? TIA |
#6
![]()
Posted to microsoft.public.excel.misc
|
|||
|
|||
![]()
Where is this typed into?..... the Header or some other place?
I tried putting it into the header and it returned what I typed. Thanks, Dennis "Gord Dibben" wrote: Sub CellInFooter() With ActiveSheet .PageSetup.CenterFooter = .Range("A1").Value End With End Sub Gord Dibben MS Excel MVP On Thu, 18 Oct 2007 03:50:02 -0700, Smudge wrote: Hi everyone, Is it possible to use a cell reference in the custom header to pick up info in a cell in the worksheet? TIA |
#7
![]()
Posted to microsoft.public.excel.misc
|
|||
|
|||
![]()
See
http://www.mvps.org/dmcritchie/excel/getstarted.htm In article , DMc wrote: Where is this typed into?..... the Header or some other place? I tried putting it into the header and it returned what I typed. |
#8
![]()
Posted to microsoft.public.excel.misc
|
|||
|
|||
![]()
Since you're not familiar with VBA and macros, see David McRitchie's site for
more on "getting started". http://www.mvps.org/dmcritchie/excel/getstarted.htm Or Ron de Bruin's site for where to place code. http://www.rondebruin.nl/code.htm In the meantime.......... First...create a backup copy of your original workbook. To create a General Module, hit ALT + F11 to open the Visual Basic Editor. Hit CRTL + r to open Project Explorer. Find your workbook/project and select it. Right-click and InsertModule. Paste the code in there. Save the workbook and hit ALT + Q to return to your workbook. Run or edit the macro by going to ToolMacroMacros. You can also assign this macro to a button or a shortcut key combo or stick it in a BeforePrint event. Gord On Wed, 31 Oct 2007 07:59:01 -0700, DMc wrote: Where is this typed into?..... the Header or some other place? I tried putting it into the header and it returned what I typed. Thanks, Dennis "Gord Dibben" wrote: Sub CellInFooter() With ActiveSheet .PageSetup.CenterFooter = .Range("A1").Value End With End Sub Gord Dibben MS Excel MVP On Thu, 18 Oct 2007 03:50:02 -0700, Smudge wrote: Hi everyone, Is it possible to use a cell reference in the custom header to pick up info in a cell in the worksheet? TIA |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Link page header with cell contents | Excel Worksheet Functions | |||
Can I link a cell's contents to the header or footer in Excel? | Excel Discussion (Misc queries) | |||
can I use a cell's contents as part of a custom header? | Excel Discussion (Misc queries) | |||
Can you link a custom property to an Excel custom header text? | Setting up and Configuration of Excel | |||
excel - insert cell contents in a custom header / footer | Excel Discussion (Misc queries) |