Thanks
I'm assuming the cell in question is in a print title row?
This problem came up a few weeks ago. The solution (from Dana DeLouis, as I
remember) for a workbook that prints one page wide and multiple columns high
went something like this:
Sub PrintWithPageNumber()
Dim NumPages As Long, P As Long
NumPages = Application.ExecuteExcel4Macro("GET.DOCUMENT(50")
For P = 1 To NumPages
Range("J1").Value = "Page " & P
ActiveSheet.Printout From:=p, To:=p
Next P
End Sub
If the workbook is more than one page wide, you'll have to put the page number
in multiple cells so the part of row 1 that's included on that page has the
number.
> NumPages = Application.ExecuteExcel4Macro("GET.DOCUMENT(50")
Oops. There's typo there. Right parenthesis is missing. It should be:
NumPages = Application.ExecuteExcel4Macro("GET.DOCUMENT(50)")