Hi All,
I am new to VBA and am really struggling to work this one out.
I am creating a document in excel which I want when printed to look like a normal word document or PDF. So far the formatting for this is going well but I have found a hiccup when trying to create a Table of Contents sheet.
At the moment I have 11 sheets in my workbook.
Sheet 1 - Information page (Where my user will put information in that will be added to different sections of the document)
Sheet 2 - Formula Information Page (Basically my dumping point for all the information in my formulas)
Sheets 3-11 - Are my final document sheets.
For the most part all of my "final document sheets" consist of one page per worksheet. However there is one worksheet (worksheet #7) which will be varying pages long depending on the information that gets added. I have got my footer page numbers to work so that no matter how many extra pages get added to worksheet #7 it adjusts the page numbers for the following worksheets.
Now I want to include these page numbers into a table of contents page. I need the table of contents page numbers to automatically update depending on the footer page numbers in each worksheet.
I have tried writing a very simple VBA code to get the information from the footer of each page into the cells for the contents page. However it does not return the actual number value it only returns the page formula (being &P).
Does anyone know how I can get this to work?
I am new to VBA and am really struggling to work this one out.
I am creating a document in excel which I want when printed to look like a normal word document or PDF. So far the formatting for this is going well but I have found a hiccup when trying to create a Table of Contents sheet.
At the moment I have 11 sheets in my workbook.
Sheet 1 - Information page (Where my user will put information in that will be added to different sections of the document)
Sheet 2 - Formula Information Page (Basically my dumping point for all the information in my formulas)
Sheets 3-11 - Are my final document sheets.
For the most part all of my "final document sheets" consist of one page per worksheet. However there is one worksheet (worksheet #7) which will be varying pages long depending on the information that gets added. I have got my footer page numbers to work so that no matter how many extra pages get added to worksheet #7 it adjusts the page numbers for the following worksheets.
Now I want to include these page numbers into a table of contents page. I need the table of contents page numbers to automatically update depending on the footer page numbers in each worksheet.
I have tried writing a very simple VBA code to get the information from the footer of each page into the cells for the contents page. However it does not return the actual number value it only returns the page formula (being &P).
Does anyone know how I can get this to work?