Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
Code to insert a Page Break
I would like to know if it is possible to write a VB code
to insert page breaks into a spreadsheet when a value is encountered in a column. I am using Excel 2002 |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
Code to insert a Page Break
I'd modify JE's code slightly to avoid A1 and maybe remove all the existing page
breaks. Option Explicit Sub test() Const MYVAL As Double = 1 Dim cell As Range ActiveSheet.ResetAllPageBreaks For Each cell In Range("A2:A" & _ Range("A" & Rows.Count).End(xlUp).Row) If cell.Value = MYVAL Then _ ActiveSheet.HPageBreaks.Add Befo=cell Next cell End Sub Moore wrote: I would like to know if it is possible to write a VB code to insert page breaks into a spreadsheet when a value is encountered in a column. I am using Excel 2002 -- Dave Peterson |
#3
Posted to microsoft.public.excel.programming
|
|||
|
|||
Code to insert a Page Break
Thanks for the info, the code worked beautifully.
*** Sent via Developersdex http://www.developersdex.com *** Don't just participate in USENET...get rewarded for it! |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Insert Page Break | Excel Discussion (Misc queries) | |||
How do I insert a page break between every row and column? | Excel Discussion (Misc queries) | |||
INSERT ROW AND PAGE BREAK | Excel Discussion (Misc queries) | |||
cannot insert page break | Excel Discussion (Misc queries) | |||
Insert Page Break | Excel Discussion (Misc queries) |