Header and cell referencing

D

dhughes20

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
 
G

Gord Dibben

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
 
D

dhughes20

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
 
Top