K
Karen53
Hi,
I have the following BeforePrint routine in my ThisWorkbook module which
places a custom header on pages based on the value of cells in the sheet. It
worked except now if the value of the cell changes, it is not picking up the
change and stays with the old value in the header. This there something I
am missing?
Private Sub Workbook_BeforePrint(Cancel As Boolean)
'add custom header to pages before printing
With SumbyLineItempg.PageSetup
.CenterHeader = "&C&14&B" & SumbyLineItempg.Range("E2").Value & _
"&4" & vbCrLf & "&12&A" & vbCrLf & " "
End With
With LineItemspg.PageSetup
.CenterHeader = "&C&14&B" & LineItemspg.Range("C2").Value & _
"&4" & vbCrLf & "&12&A" & vbCrLf & " "
End With
With MainPagepg.PageSetup
.CenterHeader = "&C&14&B" & MainPagepg.Range("B1").Value & _
"&4" & vbCrLf & "&12&A" & vbCrLf & " "
End With
End Sub
I have the following BeforePrint routine in my ThisWorkbook module which
places a custom header on pages based on the value of cells in the sheet. It
worked except now if the value of the cell changes, it is not picking up the
change and stays with the old value in the header. This there something I
am missing?
Private Sub Workbook_BeforePrint(Cancel As Boolean)
'add custom header to pages before printing
With SumbyLineItempg.PageSetup
.CenterHeader = "&C&14&B" & SumbyLineItempg.Range("E2").Value & _
"&4" & vbCrLf & "&12&A" & vbCrLf & " "
End With
With LineItemspg.PageSetup
.CenterHeader = "&C&14&B" & LineItemspg.Range("C2").Value & _
"&4" & vbCrLf & "&12&A" & vbCrLf & " "
End With
With MainPagepg.PageSetup
.CenterHeader = "&C&14&B" & MainPagepg.Range("B1").Value & _
"&4" & vbCrLf & "&12&A" & vbCrLf & " "
End With
End Sub