There have been other similar threads on here, but none have fixed this issue.
I want to insert content into the header of the spreadsheet, and the way to do this (I believe) is to use the Workbook_Before_Print() function:
However, it isn't working - nothing is appearing in the Immediate window of the VBA editor. I can confirm that events are enabled because Worksheet_Change() works OK and as expected:
Why does the Workbook_BeforePrint function not work? I don't actually need to get this to work, providing I can populate the header/footer of the sheet before printing.
Many thanks,
Steve
I want to insert content into the header of the spreadsheet, and the way to do this (I believe) is to use the Workbook_Before_Print() function:
Code:
Private Sub Workbook_BeforePrint(Cancel As Boolean)
Debug.Print "Running Workbook_BeforePrint"
Cancel = True
End Sub
However, it isn't working - nothing is appearing in the Immediate window of the VBA editor. I can confirm that events are enabled because Worksheet_Change() works OK and as expected:
Code:
Private Sub Worksheet_Change(ByVal Target As Range)
MsgBox "You just changed " & Target.Address
End Sub
Why does the Workbook_BeforePrint function not work? I don't actually need to get this to work, providing I can populate the header/footer of the sheet before printing.
Many thanks,
Steve