Remove Excel Header and Footer Text While Keeping a Watermark
Question details
Remove worksheet header and footer text with VBA while preserving a watermark stored as a header picture.

- Product
- Microsoft Excel
- Device & OS
- not provided
- Scenario
- A worksheet has header and footer text and a watermark inserted as a header picture.
- Observed behavior
- Clearing the header string also removes the graphic placeholder needed to display the watermark.
In desktop Excel, open Page Layout view and check which header section contains the watermark picture. The example below assumes the picture is already assigned to the center header and that no other header or footer pictures need to be preserved.
Keep the Center Header Picture Placeholder When Clearing Text
Use this VBA macro when the watermark is already stored as a center-header picture.
The &G code is the placeholder that displays a header picture. Set the center header directly to &G instead of clearing it first; this removes its text while retaining the picture placeholder.
In desktop Excel, select the worksheet to update, then choose Developer > Visual Basic.
In the VBA editor, choose Insert > Module and paste: Sub KeepWatermark() With ActiveSheet.PageSetup .LeftHeader = "" .CenterHeader = "&G" .RightHeader = "" .LeftFooter = "" .CenterFooter = "" .RightFooter = "" End With End Sub
Return to Excel, choose Developer > Macros, select KeepWatermark, and click Run. Open File > Print to check that the watermark remains and the unwanted text is gone.

Edit Excel Workbooks with WPS Spreadsheets
WPS Office is a free, lightweight alternative for working with Excel files in a familiar interface. Open existing workbooks to migrate your everyday spreadsheet work, and check header pictures and macros for compatibility before relying on them.

Frequently Asked Questions
Why does clearing the header remove my watermark?
A header watermark is displayed through the &G picture placeholder. Setting that header to an empty string removes the placeholder along with the text.
How do I preserve a watermark in the left header instead?
In the macro, set .LeftHeader = "&G" and clear the other sections only if they contain no pictures you need to keep. The picture must already be assigned to the left header.
Can I run this VBA macro in Excel for the web?
No. Open the workbook in desktop Excel and use Developer > Visual Basic to add the macro, then Developer > Macros to run it.
How can I check whether the watermark will print?
After running the macro, select File > Print and inspect the print preview. If the watermark is missing, check that the picture is assigned to the header section containing &G.




