G
Guest
Hi Group,
I am new to programming so please bear with me
I am trying to force the contents of cell A1 to the center header field
everytime the cell is changed. I have written the code to place the contents
into the header but need help with the change event. I am getting a syntax
error.
TIA for the help and any advise to improve my skills
Header code
Sub HeaderFromCell()
ActiveSheet.PageSetup.CenterHeader = _
Format(Worksheets("Action List").Range("A2").Value)
End Sub
Change code
Private Sub Worksheet_Change(ByVal Target As Range)
If Target.Cells = (2, 1)Then HeaderFromCell ()
End Sub
I am new to programming so please bear with me
I am trying to force the contents of cell A1 to the center header field
everytime the cell is changed. I have written the code to place the contents
into the header but need help with the change event. I am getting a syntax
error.
TIA for the help and any advise to improve my skills
Header code
Sub HeaderFromCell()
ActiveSheet.PageSetup.CenterHeader = _
Format(Worksheets("Action List").Range("A2").Value)
End Sub
Change code
Private Sub Worksheet_Change(ByVal Target As Range)
If Target.Cells = (2, 1)Then HeaderFromCell ()
End Sub