PDA

View Full Version : [SOLVED] Setting Header/Footer issues



nikki333
11-17-2018, 12:32 PM
Hi Folks

I'm trying to set the header/footer before printing. The issue only a minor one, but still annoying:

In the picture below, the left header has an indent of 1 character, which is the actual issue.

23218

In my code I define a string for the left header, which doesn't contain any blank spaces. However, when looking at the page setup for headers/footers, there's a preset list that shows my string with a leading space.

Any ideas how to get rid of this?

Below are the relevant lines of code:


strLeftHeader = "&B" & "My Company Name" & "&B" & vbLf & wbRüstplan.Name

ws.PageSetup.LeftHeader = "&L &""Calibri Light"" &09" & strLeftHeader

Paul_Hossler
11-17-2018, 03:09 PM
See if this works any better




strLeftHeader = "&B" & "My Company Name" & "&B" & vbLf & "wbRustplan.The.Name"
ActiveSheet.PageSetup.LeftHeader = "&L&""Calibri Light""&09" & strLeftHeader

nikki333
11-18-2018, 05:43 AM
Thanks very much Paul, that works :)

Paul_Hossler
11-18-2018, 06:03 AM
Good -- it was the space after the &L