K
kaken6
Hi, I've been trying to use a cell reference in the header of my excel
worksheets. The cell, B11, is in Worksheet1. I have the header
updated when the worksheet is opened. The code looks like:
Private Sub Worksheet_Activate()
Worksheets("Worksheet1").PageSetup.LeftHeader =
Range("Worksheet1'!B11").Value
End Sub
It works well for Worksheet1
But when I try to reference the same cell for my other worksheets with
code looking like:
Private Sub Worksheet_Activate()
Worksheets("Worksheet2").PageSetup.LeftHeader =
Range("Worksheet1'!B11").Value
End Sub
I get a runtime error '1004':
Method 'Range' of object '_Worksheet' failed
Does anyone know how to correct this?
Also, is there some way I can make the cell reference italicized in
the header?
Thank you!
worksheets. The cell, B11, is in Worksheet1. I have the header
updated when the worksheet is opened. The code looks like:
Private Sub Worksheet_Activate()
Worksheets("Worksheet1").PageSetup.LeftHeader =
Range("Worksheet1'!B11").Value
End Sub
It works well for Worksheet1
But when I try to reference the same cell for my other worksheets with
code looking like:
Private Sub Worksheet_Activate()
Worksheets("Worksheet2").PageSetup.LeftHeader =
Range("Worksheet1'!B11").Value
End Sub
I get a runtime error '1004':
Method 'Range' of object '_Worksheet' failed
Does anyone know how to correct this?
Also, is there some way I can make the cell reference italicized in
the header?
Thank you!