I'm having issue with a macro that I never used to have issues with. The code goes through the Header/Footer of each worksheet within the workbook and updates it with three lines in the Left Header:
Company Name
Program
Effective Date
It also adds in a logo that we use in the right footer and sheet name in the left footer. Here is the code:
I'm getting a Run-time error 1004 with the following line:
Is the syntax off? What am I doing wrong? Thanks in advance.
Company Name
Program
Effective Date
It also adds in a logo that we use in the right footer and sheet name in the left footer. Here is the code:
Code:
Sub header_footer_unscale_new()Dim ws As Worksheet
For Each ws In ActiveWorkbook.Worksheets
With ws.PageSetup
.ScaleWithDocHeaderFooter = False
.TopMargin = Application.InchesToPoints(0.9)
.LeftHeader = "&""Arial,Bold""&8Company Name" & vbCr & "Program" & vbCr & "Effective July 1, 2018"
.RightHeader = ""
.LeftFooter = "&""Arial Narrow,Regular""&A"
.RightFooter = "&G" 'specifies that you want an image in your footer
.RightFooterPicture.Filename = "C:\Users\User1\Desktop\Excel Logo.jpg" 'specifies the image file
End With
ActiveWindow.View = xlNormalView
Range("A1").Activate
Next
End Sub
I'm getting a Run-time error 1004 with the following line:
Code:
.LeftHeader = "&""Arial,Bold""&8Company Name" & vbCr & "Program" & vbCr & "Effective July 1, 2018"
Is the syntax off? What am I doing wrong? Thanks in advance.