How to get the Right Header Number to change after every print?

G

Guest

I have the macro below that will show the counter on the printed sheet but I
need the number to change with each print from the right header text. I was
lucky to get the code below and information from Gord Dibben and Gary''s
Student. I would really appreciate any help I can get. Thanks Jennifer


This macro will create a custom property that will hold the counter:
 
G

Gord Dibben

Jennifer

I have tested this and I get an incremented number in right header each time I
print the sheet. Even after saving/closing then reopening.

What are you getting for a number in right header?

Only change I would make is to make the value in "jenny" a zero rather than 1 to
start with.

Sub firstone()
Dim dp As DocumentProperties
Set dp = ThisWorkbook.CustomDocumentProperties
dp.Add Name:="jenny", _
LinkToContent:=False, _
Type:=msoPropertyTypeNumber, _
Value:=0
End Sub

Go to File>Properties>Custom and delete the "jenny" property then re-run the
firstone macro,


Gord
 

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

Top