Paste text into a header
STEVE BELL wrote:
Below is code I recorder, and below it is after editing it...
Ok, that is exactly what I already did, but I need to paste text from
the clipboard, not a fixed text. Any idea?
Thanks,
Danny
Replace the text with a cell reference, a text reference, a result
from an InputBox or form, or a variable.
==========================
With ActiveSheet.PageSetup
.PrintTitleRows = ""
.PrintTitleColumns = ""
End With
ActiveSheet.PageSetup.PrintArea = ""
With ActiveSheet.PageSetup
.LeftHeader = "Left Header"
.CenterHeader = "Center Header"
.RightHeader = "Right Header"
.LeftFooter = ""
.CenterFooter = ""
.RightFooter = ""
.LeftMargin = Application.InchesToPoints(0.75)
.RightMargin = Application.InchesToPoints(0.75)
.TopMargin = Application.InchesToPoints(1)
.BottomMargin = Application.InchesToPoints(1)
.HeaderMargin = Application.InchesToPoints(0.5)
.FooterMargin = Application.InchesToPoints(0.5)
.PrintHeadings = False
.PrintGridlines = False
.PrintComments = xlPrintNoComments
.CenterHorizontally = False
.CenterVertically = False
.Orientation = xlPortrait
.Draft = False
.PaperSize = xlPaperLetter
.FirstPageNumber = xlAutomatic
.Order = xlDownThenOver
.BlackAndWhite = False
.Zoom = 100
End With
================================
With ActiveSheet.PageSetup
.LeftHeader = "Left Header"
.CenterHeader = "Center Header"
.RightHeader = "Right Header"
End With
========================================
|