Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Module to set Page Breaks based on criteria through code

We have a macro that looks at a worksheet which can be up to 200 rows
long. Each row is the same height. Each section in this worksheet has
a letter value assigned to it A, B, C, etc.

Based upon certain conditions the macro will move certain sections of
the data to a new worksheet named Long_Quote, it will auto number all
the rows that come into this new worksheet 1 - whatever, and column B
will have the section codes for the data that came across.

Example:

ColumnA ColumnB
1 A
2 A
3 C
4 C
5 E

etc.

Since each row in the worksheet Long_Quote where the data has come
across is the same row height we need a module that will do the
following:

If we specify 40 as the maximum number of rows to print on one page the
module needs to set a page break at the last change of columnB values
BEFORE THE VALUE OF COLUMNA REACHES 40.

Scenario:
37 A
38 B
39 B
40 B
41 B

In this situation, we would need to set a page break to be set right
below the cell in columnA containing 37, because we do not want to
break up any section of data in the middle of a page break,then go up
to another 40 rows and repeat this process until there are no longer
any numbers in columnA.


---
Message posted from http://www.ExcelForum.com/

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
code in module A to not execute a Worksheet_SelectionChange sub of another module Jack Sons Excel Discussion (Misc queries) 4 December 11th 05 11:52 PM
Auto insert page breaks in Excel, based on a sort of numbers peterc89 Excel Discussion (Misc queries) 0 November 9th 05 03:41 PM
Excel XP VBA code to search all macro code in Excel module for specific search string criteria Ed[_18_] Excel Programming 4 May 20th 04 02:08 PM
Excel XP VBA code to search all macro code in Excel module for specific search string criteria Frank Kabel Excel Programming 0 May 19th 04 08:11 PM
Excel VBA to search all macro code in Excel module for specific string criteria Roger1947 Excel Programming 0 May 19th 04 05:51 PM


All times are GMT +1. The time now is 06:34 PM.

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

About Us

"It's about Microsoft Excel"