Link Header to a cell

pagrender

Well-known Member
Joined
Sep 3, 2008
Messages
652
Hello,

Is there a way to have a header be populated by the value in a cell?

For example, I want the header to reflect the value of cell A1.

I've been trying some things but haven't had any luck.

Thanks.
 

Excel Facts

Bring active cell back into view
Start at A1 and select to A9999 while writing a formula, you can't see A1 anymore. Press Ctrl+Backspace to bring active cell into view.
I found this code online but it doesn't work. I get a "Compile Error: Expected End With" message. Can someone let me know what's wrong?

Private Sub Worksheet_Change(ByVal Target As Range)
If Target.Address = "$B$3" Then
With ActiveSheet.PageSetup.LeftHeader = [B3]
End Sub
 
Upvote 0
Code:
Sub headerofactivesheet()
    ActiveSheet.PageSetup.CenterHeader = "Is this it?"
End Sub

I think I see now..
 
Upvote 0
Thanks Repairman!

I found this while I was waiting, and it looks exactly like your solution:

ActiveSheet.PageSetup.LeftHeader = Range("A1").Value

Thanks again!
 
Upvote 0
Your welcome and I believe you could also do rightheader...seems there is three orientations.
 
Last edited:
Upvote 0
Hi all

I would like to continue this discussion further, is there a way to add "last updated &date & time" on a seperate line
Code:
Sub headerofactivesheet()
ActiveSheet.PageSetup.RightHeader = "Version " & Range("b1").Value & " Last updated " & Date & " - " & Time
End Sub
 
Upvote 0
Solved

Code:
Sub headerofactivesheet()
ActiveSheet.PageSetup.RightHeader = "Version " & Range("b1").Value & Chr(10) & " Last updated " & Date & " - " & Time
End Sub
 
Upvote 0
Hi

Picking up on an old trend.

I would like to turn this topic on it's head and ask if there is a way of copying the contents of Header Left to Cell A1.

Many thanks

Hj
 
Upvote 0

Forum statistics

Threads
1,223,721
Messages
6,174,096
Members
452,542
Latest member
Bricklin

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top