Workbook_Before P_rint()

Exeler

New Member
Joined
Aug 25, 2016
Messages
8
I'm stuck.... I want to use VB to add a Header before it prints. Here is my code, but I print and it doesn't work... IFSPB & IFSPB are my sheet names... I must be overlooking something because this seems like it should work.... Can anyone help? I'd really appreciate it!

Code:
Private Sub Workbook_BeforePrint(Cancel As Boolean)

IFSPB.FirstPage.LeftHeader.Text = vbCr & "&""Times New Roman,bold""&12" & "Child's Name:  " & Worksheets("IFSPA").Range("M10").Value

End Sub
 

Excel Facts

Best way to learn Power Query?
Read M is for (Data) Monkey book by Ken Puls and Miguel Escobar. It is the complete guide to Power Query.
Workbook Before_Print

Works!!! Needed to put code in "ThisWorkbook" :cool:
Code:
Private Sub Workbook_BeforePrint(Cancel As Boolean)
Worksheets("IFSPB").PageSetup.FirstPage.LeftHeader.Text = vbCr & "&""Times New Roman,bold""&12" & "Child's Name:  "
End Sub
 
Upvote 0

Forum statistics

Threads
1,220,965
Messages
6,157,120
Members
451,399
Latest member
alchavar

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