Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 16
Default place cell value in header

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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11,058
Default place cell value in header

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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 16
Default place cell value in header

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
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
I want to place a checkbox in the middle of a cell, yet I want thecheckboxArea take up the entire cell. Leonid L Excel Discussion (Misc queries) 2 July 30th 08 04:25 PM
How do I place Range text into a header? Brad Excel Worksheet Functions 1 January 12th 07 01:46 AM
Place the first and last name on ever page printed in header Keith Excel Discussion (Misc queries) 0 November 2nd 05 11:18 PM
Can I place a formula/cell reference in the Header/footer Excel john mcmichael Excel Worksheet Functions 2 August 11th 05 09:10 PM
how to place values in custom header Thomas Grassi Excel Programming 2 April 2nd 05 10:37 PM


All times are GMT +1. The time now is 08:10 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"