Formatting & Inserting Rows

DWE

New Member
Joined
May 18, 2011
Messages
1
Hi guys - I am a complete newbie here, so please bare with me.
I have created a report in excel which effectively consists of about 3000 lines of data. I need to develop that into a report which can be printed. At the bottom of each page, I need to insert a "footer" which contains sub-totals of the numbers on that page, with a carried forward balance on the top of the page commencing page 2. I wuould really like to automate this functionality through VBA.
I envisage that the logic to answer my question will be as follows:
1. find the bottom of the first page break and insert a new row with the cell in column C to contain the calculations of the numbers above it and some text in that row in column D
2. at the top of the next page insert a new row with the cell in column C to contain the calculations of the numbers above it and some text in that row in column D
3. find the top of the next page and repeat 1 and 2
4. until the final page when item 1 is completed, we go to the last row and insrt another with the sub-total for the page and under that another row which contains the total of all of column C on all pages.
Row counting is not really an option to use to guage when to insert a row - each row varies in height as a result of the text in Column D, so I guess the only way is to work out the print area, work out what is the last row on that print area and insert a new row immediately above it (moving the old row to the first row on the next page).
I hope my question is clear - if any clarification is required please ask.
MTIA
Regards
DWE
 

Excel Facts

Can a formula spear through sheets?
Use =SUM(January:December!E7) to sum E7 on all of the sheets from January through December

Forum statistics

Threads
1,224,599
Messages
6,179,828
Members
452,946
Latest member
JoseDavid

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top