Sub PrintWithPgNumInTitleRow()
'print with page number in A1
Dim NumPages As Long, Pg As Long
NumPages = ExecuteExcel4Macro("Get.document(50)")
ActiveSheet.Range("TotalPages").Value = NumPages
For Pg = 1 To NumPages
With ActiveSheet
.Range("A1").Value = Pg
.PrintOut from:=Pg, To:=Pg
End With
Next Pg
End Sub
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.