PDA

View Full Version : Print "Repeat rows from bottom of worksheet"



Fuzzy99
12-13-2006, 02:03 AM
Hi,

Just wondering if there any way to print repeat rows from bottom of worksheet? I have a worksheet which I have inserted multiple page breaks on it. I would like to print each of these pages to include the summary of the grand total which can be found at the bottom rows of the worksheet. Pls help :bow:

Br,
Fuzzy

Charlize
12-13-2006, 02:45 AM
Putting this in a worksheet before print event will add the value of cel E3 in footer for every page.
ActiveSheet.PageSetup.LeftFooter = "Total : " & Range("E3").Text & " €"
If the footer needs to be changed on every page you'll have to count all the pages and for each page determine the text in the footer (maybe array of number of pages so arrayvalue(0) would be pagefooter page 1) and for each page change the footer.

Charlize

ps. when formatting the sheet with pagebreaks, maybe already store the value for the footer. then use redim preserve before adding a value to the array.

mdmackillop
12-13-2006, 11:35 AM
Hi Fuzzy,
The simplest way I've found to do this is to create a couple of rows containing the summing formula and a carry forward below. You can then use code to make a temporary copy of your spreadsheet, copy and paste this into every 40th row or so to suit your page setup. This does rely on equal row heights throughout.
Regards
MD

Charlize
12-14-2006, 04:01 AM
Maybe make a sheet per page you want to print. First row contains the running balance. So make FootP1, FootP2, FootP3 (automatic of course) ... as many as there are pages.

Then using a loop to store no of pages. Then we print page per page and changing the footer accordingly.

When inserting the pagebreaks I would already make the footer sheets and the counter for the number of pages. You could hide them if necessary. After printing your report, delete the footersheets.

Charlize