Print Macro - footer specific

N

Nick

Hello All,

I was wondering whether someone can help me with a macro
that does the following...

- prints the document by pressing a button only
- prints on the footer of each page the companies name in
cell reference B5
- will NOT print if there is no company name entered in
cell reference B5

If anyone can help me out with this it would be greatly
appreciated.

With thanks
Nick
 
T

Ture Magnusson

Nick,

Here's a small procedure that should do what you ask for.
Instead of "ActiveSheet.PrintOut", you could use
"Application.Dialogs(xlDialogPrint).Show" to allow the
user to select printer before printing.

Sub NicksPrintOut()
If Trim(Range("B5").Value) = "" Then Exit Sub

ActiveSheet.PageSetup.RightFooter = Trim(Range("B5").Value)
ActiveSheet.PrintOut
ActiveSheet.PageSetup.RightFooter = ""
End Sub

Ture Magnusson
Karlstad, Sweden
 
Top