View Single Post
  #8   Report Post  
Posted to microsoft.public.excel.programming
G.Hott G.Hott is offline
external usenet poster
 
Posts: 4
Default Page X of Y in Worksheet

Thanks - this seems to be the closest.
--
G. Hott


"ruic" wrote:
This is very close. However it's giving me the # of worksheets in the book.
What i need is the number of pages in the sheet. - Basically what you would
normally get by inserting page 'x' of 'y' in the header.
Thanks for helping me out.

Try something like this:

I = 1;
For Each WkSheet in Application.ActiveWorkbook.Windows(1)
Range("A1:A1).Value = I
I = I + 1
Next

What is does is it goes through the worksheets in the current workbook that
is selected. Just in case you have more than one open workbook, and then
puts the value of I in cell A1. But you can have put whatever you want in
cell A1 or any other cell by changing the Range value.

--
Rui


"G.Hott" wrote in message
...
Good morning! I'm really hoping someone can assist me.
I have a worksheet with a title block in rows 1-13. This title block
repeats
on each sheet. I would like for a cell to show when printed "Sheet 'x' of
'y'". Is this possible?

--
G. Hott