Does anyone know the code to put a number in the right header...

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

Guest

Does anyone know the code to put a number in the right header and have the
number change everytime you print? This number has nothing to do with the
worksheet itself, it is a totally different number.

This is what I am using to do the regular printing in the spreadsheet and
would like it to be changed for the right header only no cell reference:

Private Sub Workbook_BeforePrint(Cancel As Boolean)
If ActiveSheet.Name = "Sheet1" Then
ActiveSheet.Range("K1").Value = ActiveSheet.Range("K1").Value + 1
End If
End Sub

Thanks sorry for the double post but I haven't received an answer to help me.
Jennifer
 
Thanks Gary for your input but it still does not work. I changed "jenny" to
my worksheet name and now I get an error. What am I doing wrong?
 
Don't change "jenny" to your worksheet name.

"jenny" is the custom property you are adding to File Properties.


Gord Dibben MS Excel MVP
 
Thanks for your reply. I entered it in exactly as you said and it shows it on
the print preview but still does not add a number every time I print. Any
solution?? Sorry for bugging you, I guess I need to take a class on this.
Thanks,
Jennifer
 
Back
Top