PDA

View Full Version : Insert Page Break when values change



Nosstech
10-27-2008, 11:42 AM
Hi All,

I need to place a page break after values change in Col B. Does anyone have a snipit of code, I can pop in?

Thx

GTO
10-27-2008, 11:47 AM
And where would the page break go; below the last used cell in col B?

Is it a vertical or horizontal break?

Nosstech
10-27-2008, 05:44 PM
And where would the page break go; below the last used cell in col B?

Is it a vertical or horizontal break?
The page break would be horizontal and be placed between the cells with different values.
Thanks

GTO
10-27-2008, 07:09 PM
Greetings Nosstech,


...page break after values change in Col B...

...and be placed between the cells with different values...

According to your first descript, every time a value changes in any cell in column B, a pager break should be inserted somewhere...

And per the the second descript, if B1 = 5, B2 = 934, B3 = 909, etc - there would be a page break at each row.

Here is a horizontal page break between rows 30 and 31, on Sheet1 (codename, not tab name).

Sheet1.HPageBreaks.Add Before:=Sheet1.Cells(31, 1)

I would suggest attaching an example workbook and a better description of what is likely to be happening. IE - There are several different ranges in Col B and users may be inserting rows as they enter data, or, There is one contiguoius range, or etc.

This way someone could probably provide a solution as to resetting page breaks as necessary...

Hope this helps,

Mark