![]() |
Macro for Custom Header
Hello,
How do I manage to get the macro that I have to display each worksheet name within the workbook accordingly. Anytime I run the macro in question, the workbook name displays correctly on each worksheet but the worsheet name does not match. In fact, it assigns all worksheets the same name (i.e. sheet 1). Please Help! Public Sub DoFullPath() Dim ws As Worksheet For Each ws In ActiveWorkbook.Sheets With ws.PageSetup .CenterHeader = ActiveWorkbook.Name & _ vbLf & ActiveSheet.Name End With Next ws End Sub Thanks, |
Macro for Custom Header
Le Jurassien,
ActiveSheet isn't being changed, hence the same name. Try: .CenterHeader = ActiveWorkbook.Name & _ vbLf & ws.Name -- Earl Kiosterud www.smokeylake.com ----------------------------------------------------------------------- "Le Jurassien" wrote in message ... Hello, How do I manage to get the macro that I have to display each worksheet name within the workbook accordingly. Anytime I run the macro in question, the workbook name displays correctly on each worksheet but the worsheet name does not match. In fact, it assigns all worksheets the same name (i.e. sheet 1). Please Help! Public Sub DoFullPath() Dim ws As Worksheet For Each ws In ActiveWorkbook.Sheets With ws.PageSetup .CenterHeader = ActiveWorkbook.Name & _ vbLf & ActiveSheet.Name End With Next ws End Sub Thanks, |
All times are GMT +1. The time now is 04:39 AM. |
Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com