Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
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 |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
code in module A to not execute a Worksheet_SelectionChange sub of another module | Excel Discussion (Misc queries) | |||
Auto insert page breaks in Excel, based on a sort of numbers | Excel Discussion (Misc queries) | |||
Excel XP VBA code to search all macro code in Excel module for specific search string criteria | Excel Programming | |||
Excel XP VBA code to search all macro code in Excel module for specific search string criteria | Excel Programming | |||
Excel VBA to search all macro code in Excel module for specific string criteria | Excel Programming |