chipsworld
Board Regular
- Joined
- May 23, 2019
- Messages
- 161
- Office Version
- 365
I have a Sheet that I am trying to format the header on... I have the code to create the header, but can't get the line spacing right...
Any help would be great...
Here is what I have:
unitype and unitnam are strings from a userform.
When I run this is looks like this:
38 MP CO - DEMOB OUT
MASTER ROLL UP
07 May 2020
and I need it to look like this
38 MP CO - DEMOB OUT
MASTER ROLL UP
07 May 2020
How do I get rid of the line between each line??
Any help would be great...
Here is what I have:
unitype and unitnam are strings from a userform.
When I run this is looks like this:
38 MP CO - DEMOB OUT
MASTER ROLL UP
07 May 2020
and I need it to look like this
38 MP CO - DEMOB OUT
MASTER ROLL UP
07 May 2020
How do I get rid of the line between each line??
VBA Code:
Sub addHeaders(unitnam)
Dim ws As Worksheet
Dim unitype As String
unitype = Me.cmbtype.Value
Set ws = Worksheets("Template")
Application.ScreenUpdating = False
With ws.PageSetup
.CenterHeader = "&B""&12" & unitnam & " - " & unitype & vbCrLf & "MASTER ROLL UP" & vbCrLf & Format(Date, ("dd MMM yyyy"))
.CenterVertically = True
.CenterHorizontally = True
.AlignMarginsHeaderFooter = True
End With
Set ws = Nothing
Application.ScreenUpdating = True
End Sub