Excel 2013 Separate headers for each worksheet

I've been looking for a way to have separate headers for each worksheet in my workbook and haven't found it yet.
Frank FreeseAsked:
Who is Participating?

[Product update] Infrastructure Analysis Tool is now available with Business Accounts.Learn More

I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

Can you clarify what you mean by separate headers?
Frank FreeseAuthor Commented:
For each worksheet I am trying to add a different header from the previous worksheet. I am not referring to a page but worksheets themselves. For example, the tab for worksheet one is labeled "Main Menu" whereas the second tabled labeled "SELECT" and each worksheet's header would be different - the header for the first tab would be "Main Menu" and the header for the second tab would be "Select", and so on.
Saurabh Singh TeotiaCommented:
Their you go..You can use the following code...which will add sheet name only in the header..

Sub addheaders()
    Dim ws As Worksheet

    For Each ws In ActiveWorkbook.Worksheets
        With ws.PageSetup
            .CenterHeader = ws.Name
        End With
    Next ws

End Sub

Open in new window


Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
PMI ACP® Project Management

Prepare for the PMI Agile Certified Practitioner (PMI-ACP)® exam, which formally recognizes your knowledge of agile principles and your skill with agile techniques.

Frank FreeseAuthor Commented:
thank you - I felt like vba would be needed.
Thank you. You're generous but Saurabh earned 100% of the points.  I still wasn't sure what you wanted until I saw Saurabh's solution.
Saurabh Singh TeotiaCommented:
Freese..You are welcome...Always Happy to help..

Doug...Thanks that's nice of you..I wasn't sure about it myself when freese posted the question..It's only when you probed him..and he replied that time i came to know what he was looking for..I had to read like 2-3 times again to ensure that i got it correctly.. :-)

Frank FreeseAuthor Commented:
I recognized that Saurabh provided a shooting solution, but when others respond I want to recognize them also.  If there are no other Experts trying to help then 100% is given to the solution. I also believe when there is more than one solution to share those points. I truly appreciate all the Experts!
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Microsoft Excel

From novice to tech pro — start learning today.