Wish you all Happy New Year.
Am having word template that has footer with some text on the left side of the footer and Page X of Y on the right side. Please see below screenshot:
I have data on excel that needs to be inserted on the footer of word document and hence wrote vba to perform this operation. Below is the entire VBA on excel:
Am storing required information in variable called "FooterText" and below line is inserting footer on the left side of the footer:
Since I also need page numbers to be displayed, I added below code:
But the problem is its inserting page numbers in numerals as 1, 2, 3 etc where as I want it to be inserted as Page 1 of 5, Page 2 of 5 etc.,
Below is the screenshot of footer after running the macro:
I tried to google and searched in forum as well but didn't get much help. I really appreciate any help provided.
Am attaching excel file and word document. Please let me know if any questions.