DarkJester89
Board Regular
- Joined
- Nov 5, 2017
- Messages
- 109
- Office Version
- 2016
- Platform
- Windows
I found this code, which I'm trying to convert to add just a footer, and it'll be on a print button to reflect on pages to be printed.
I only need the footer on a specific sheet, "Sheet1", and then a seperate code to remove footer after print complete.
Thank you in advance.
I only need the footer on a specific sheet, "Sheet1", and then a seperate code to remove footer after print complete.
VBA Code:
Option Explicit
Sub InsertHeaderFooter()
Dim wsAs Worksheet
Application.ScreenUpdating = False
Each wsInThisWorkbook.Worksheets
With ws.PageSetup
.LeftHeader = “Company Name:”
.CenterHeader = “Page &P of &N”
.RightHeader = “Printed &D &T”
.LeftFooter = “Path : “ &ActiveWorkbook.Path
.CenterFooter = “Workbook Name: & F”
.RightFooter = “Sheet: &A”
End With
Next ws
Set ws = Nothing
Application.ScreenUpdating = True
End Sub
Thank you in advance.