Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
Rob Rob is offline
external usenet poster
 
Posts: 718
Default Printing subtotals on same page

I have a large spreadsheet that I have setup in groups of 40 rows of 60. The
60
categories are separated by a row that is formatted with a yellow
background. Is there a way to create a print macro that would recognize the
yellow and keep everything beneath the yellow on the same page. Something
like in Access where you can create a report and use the Keep Together rule
so that if the list gets to the bottom of the page and there is not enough
room on the page to print the category with the rows of that section, it
would start a new page. The sixty rows beneath the categories can fluctuate
depending on if there is data in the rows so sometimes there could be 1 row
and sometimes 10 and sometimes 60. Any suggestions?
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 74
Default Printing subtotals on same page

Rob,

You can automate adding horizontal page breaks (as you would do manually in
Page Break Preview);

Dim lRowCounter As Long

Do Until IsEmpty(ActiveSheet.Cells(lRowCounter, 1))

If ActiveSheet.Cells(lRowCounter, 1).Interior.Color = vbYellow Then

ActiveSheet.HPageBreaks.Add
Befo=ActiveSheet.Cells(lRowCounter, 1)

End If

lRowCounter = lRowCounter + 1

Loop

This relies on there always being data in column 1 & I can't get a handle on
how to clear them off first (so difficult to repeat). The Delete method seems
to be giving me some grief, I will post back if I get any joy.

Regards,

Chris.

--
Chris Marlow
MCSD.NET, Microsoft Office XP Master


"Rob" wrote:

I have a large spreadsheet that I have setup in groups of 40 rows of 60. The
60
categories are separated by a row that is formatted with a yellow
background. Is there a way to create a print macro that would recognize the
yellow and keep everything beneath the yellow on the same page. Something
like in Access where you can create a report and use the Keep Together rule
so that if the list gets to the bottom of the page and there is not enough
room on the page to print the category with the rows of that section, it
would start a new page. The sixty rows beneath the categories can fluctuate
depending on if there is data in the rows so sometimes there could be 1 row
and sometimes 10 and sometimes 60. Any suggestions?

Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Force Page Break on Subtotals to Odd Page Jim Sheehan Excel Discussion (Misc queries) 0 October 10th 08 05:01 PM
Printing subtotals on each page slopsjon Excel Worksheet Functions 9 March 27th 08 12:35 PM
Page subtotals W.Easton Excel Discussion (Misc queries) 1 January 3rd 08 02:50 AM
Printing what I can see on the screen - subtotals [email protected] Excel Discussion (Misc queries) 0 January 8th 06 10:13 AM
Printing what I can see on the screen - subtotals [email protected] Excel Discussion (Misc queries) 0 January 8th 06 09:28 AM


All times are GMT +1. The time now is 02:35 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"