insert pagenumber in PageSetup in Excel using VB.net

R

ramesh.venkat

Hi ,

I'm creating an excel worksheet in VB.NET

While setting the print properties , I was able to print the date on
the left footer
..PageSetup.LeftFooter = "Printed on " & Today.ToShortDateString

I want to insert a pagenumber in custom footer for Excel .
At the right footer , it should print like " Page 1 of 4"
The macro is &[Page] of &[Pages] in excel.

I am not able to find the property for page and pages

If somebody could help me , I'd appreciate it


Thanks in Advance,

ramesh
 
T

Tom Ogilvy

.LeftFooter = "Printed on &D" ' Date
.CenterFooter = ""
.RightFooter = "page &P of &N" ' page n of m

Don't be afraid to use the macro recorder.
 

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