LikeButtah
Board Regular
- Joined
- Jun 24, 2011
- Messages
- 168
Please take a look at this code below. I know I'm not coding this correctly because it's not formatting the Left Header the way I would like. I want the left header to display the value of A2 like June 11, 2016 , A2 has a date like 6/11/16. The center header is fine, which is a picture. But when I try to move the left header code around it either doesn't make the font the right size or it doesn't format correctly and gives me a 6/11/16 date. Any help would be appreciated, Thanks.
Code:
Dim ws As Worksheet
For Each ws In Worksheets
ws.PageSetup.LeftHeader = Format(ws.Range("A2").Value, "mmmm d, yyyy")
ActiveSheet.PageSetup.CenterHeaderPicture.Filename = _
"C:\Users\Box\Pictures\BTW.png"
ws.PageSetup.CenterHeaderPicture.Filename = _
"C:\Users\Box\Pictures\BTW.png"
ws.PageSetup.CenterHeader = "&G"
ws.PageSetup.LeftHeader = "&""Neue,Bold""&1" & ws.Range("A2")
Application.PrintCommunication = False
With ws.PageSetup
.PrintTitleRows = "1:1"
.PrintTitleColumns = ""
End With
Application.PrintCommunication = True
ws.PageSetup.PrintArea = ""
Application.PrintCommunication = False
With ws.PageSetup
.RightHeader = ""
.LeftFooter = ""
.CenterFooter = ""
.RightFooter = ""
.LeftMargin = Application.InchesToPoints(0.5)
.RightMargin = Application.InchesToPoints(0.1)
.TopMargin = Application.InchesToPoints(1.25)
.BottomMargin = Application.InchesToPoints(0.75)
.HeaderMargin = Application.InchesToPoints(0.3)
.FooterMargin = Application.InchesToPoints(0.3)
.PrintHeadings = False
.PrintGridlines = False
.PrintComments = xlPrintNoComments
.PrintQuality = 600
.CenterHorizontally = False
.CenterVertically = False
.Orientation = xlPortrait
.Draft = False
.PaperSize = xlPaperLetter
.FirstPageNumber = xlAutomatic
.Order = xlDownThenOver
.BlackAndWhite = False
.Zoom = 100
.PrintErrors = xlPrintErrorsDisplayed
.OddAndEvenPagesHeaderFooter = False
.DifferentFirstPageHeaderFooter = False
.ScaleWithDocHeaderFooter = True
.AlignMarginsHeaderFooter = True
.EvenPage.LeftHeader.Text = ""
.EvenPage.CenterHeader.Text = ""
.EvenPage.RightHeader.Text = ""
.EvenPage.LeftFooter.Text = ""
.EvenPage.CenterFooter.Text = ""
.EvenPage.RightFooter.Text = ""
.FirstPage.LeftHeader.Text = ""
.FirstPage.CenterHeader.Text = ""
.FirstPage.RightHeader.Text = ""
.FirstPage.LeftFooter.Text = ""
.FirstPage.CenterFooter.Text = ""
.FirstPage.RightFooter.Text = ""
End With
Application.PrintCommunication = True
Next ws
Last edited: