Header and cell referencing

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

My issue is this: I have 6 sheets. The first sheet contains the clients
information. I want to take the last name of the client from the first sheet
and have it appear in the header of every sheet after it. How do I create a
cell reference inside a header?
David
 
David

Sub Path_All_Sheets()
Set wkbktodo = ActiveWorkbook
For Each ws In wkbktodo.Worksheets
ws.PageSetup.RightHeader = Sheets("Clients").Range("A1").Text
Next
End Sub

Assumes client's name is in A1

Note: you can do the same thing by right-click on first sheet tab and "select
all sheets"

Set up the header by typing in the client's name and OK

This header will be replicated on all worksheets.

DO NOT FORGET to right-click and "ungroup sheets" when task complete.

What you do to one sheet is being done to all.


Gord Dibben Excel MVP
 
Thank you very much for your repsonse. David

Gord Dibben said:
David

Sub Path_All_Sheets()
Set wkbktodo = ActiveWorkbook
For Each ws In wkbktodo.Worksheets
ws.PageSetup.RightHeader = Sheets("Clients").Range("A1").Text
Next
End Sub

Assumes client's name is in A1

Note: you can do the same thing by right-click on first sheet tab and "select
all sheets"

Set up the header by typing in the client's name and OK

This header will be replicated on all worksheets.

DO NOT FORGET to right-click and "ungroup sheets" when task complete.

What you do to one sheet is being done to all.


Gord Dibben Excel MVP
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top