I am using the following code to insert information in the page header multiple sheets.
Sub Invoice_settings()
Dim INVNO As String
'change color of sheet tab to keep track of which sheets have been assigned invoice number
ActiveSheet.Tab.ColorIndex = 38
INVNO = InputBox(Prompt:="INVOICE NUMBER", _
Title:="ENTER INVOICE NUMBER", Default:=" ")
ActiveSheet.PageSetup.PrintArea = ""
With ActiveSheet.PageSetup
.CenterHeader = "&""Arial,Bold14" & Range("BCI_ADDR").Text
.RightHeader = "&""Arial,Bold14" & Range("INVOICE").Text & INVNO
End With
ActiveWindow.SelectedSheets.PrintPreview
End Sub
The problem I am having is that it is dropping part of the first two words that are contained in the two ranges - BCI_ADDR & INVOICE.
BCI_ADDR is one cell that has the company name and complete address and is formatted with cell wrapping. It wraps to 4 lines
INVOICE contains the Invoice Date and the words "Invoice #" on a wrapped line.
I have many sheets that I need to change the print settings and was hoping to use the above for the headers.
Any suggestiong on what is causing this and, more importantly, how I can get it to work correctly without manually going into each page and editing the headers.
Sub Invoice_settings()
Dim INVNO As String
'change color of sheet tab to keep track of which sheets have been assigned invoice number
ActiveSheet.Tab.ColorIndex = 38
INVNO = InputBox(Prompt:="INVOICE NUMBER", _
Title:="ENTER INVOICE NUMBER", Default:=" ")
ActiveSheet.PageSetup.PrintArea = ""
With ActiveSheet.PageSetup
.CenterHeader = "&""Arial,Bold14" & Range("BCI_ADDR").Text
.RightHeader = "&""Arial,Bold14" & Range("INVOICE").Text & INVNO
End With
ActiveWindow.SelectedSheets.PrintPreview
End Sub
The problem I am having is that it is dropping part of the first two words that are contained in the two ranges - BCI_ADDR & INVOICE.
BCI_ADDR is one cell that has the company name and complete address and is formatted with cell wrapping. It wraps to 4 lines
INVOICE contains the Invoice Date and the words "Invoice #" on a wrapped line.
I have many sheets that I need to change the print settings and was hoping to use the above for the headers.
Any suggestiong on what is causing this and, more importantly, how I can get it to work correctly without manually going into each page and editing the headers.