Print Macro - footer specific

  • Thread starter Thread starter Nick
  • Start date Start date
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
 
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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top