Home |
Search |
Today's Posts |
|
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Hi,
I have a workbook that contains several sheets, in the current setup I have the [tab] value appearing in the header. What I would like is th value that is currently in Cell reference "A2" to appear in the header too. To make things more difficult (as I can do the referencing to cell A2) I would like the value copied into the header as a paste value type entry, so that when I delete column A later in the macro the header entry will remain. Hope this makes sense! -- K Hogwood-Thompson |
#2
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Run this macro whenever you wish to capture the value in A2 in the header:
Sub Macro1() v = Range("A2").Value ActiveSheet.PageSetup.CenterHeader = v End Sub -- Gary''s Student - gsnu200800 "KHogwood-Thompson" wrote: Hi, I have a workbook that contains several sheets, in the current setup I have the [tab] value appearing in the header. What I would like is th value that is currently in Cell reference "A2" to appear in the header too. To make things more difficult (as I can do the referencing to cell A2) I would like the value copied into the header as a paste value type entry, so that when I delete column A later in the macro the header entry will remain. Hope this makes sense! -- K Hogwood-Thompson |
#3
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Thanks Gary, this works very well I have adapted it so that it can be used on
each worksheet in the workbook, just for anyone else that is interested: For Each ws In ActiveWorkbook.Worksheets v = ws.Range("A2").Value ws.PageSetup.LeftHeader = v Next Many thanks again! -- K Hogwood-Thompson "Gary''s Student" wrote: Run this macro whenever you wish to capture the value in A2 in the header: Sub Macro1() v = Range("A2").Value ActiveSheet.PageSetup.CenterHeader = v End Sub -- Gary''s Student - gsnu200800 "KHogwood-Thompson" wrote: Hi, I have a workbook that contains several sheets, in the current setup I have the [tab] value appearing in the header. What I would like is th value that is currently in Cell reference "A2" to appear in the header too. To make things more difficult (as I can do the referencing to cell A2) I would like the value copied into the header as a paste value type entry, so that when I delete column A later in the macro the header entry will remain. Hope this makes sense! -- K Hogwood-Thompson |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
I want to place a checkbox in the middle of a cell, yet I want thecheckboxArea take up the entire cell. | Excel Discussion (Misc queries) | |||
How do I place Range text into a header? | Excel Worksheet Functions | |||
Place the first and last name on ever page printed in header | Excel Discussion (Misc queries) | |||
Can I place a formula/cell reference in the Header/footer Excel | Excel Worksheet Functions | |||
how to place values in custom header | Excel Programming |