Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
How to insert a page break in Excel VBA
Hi,
I want to insert a page break after a condition has been met. I created a recorded macro to see what the code looks like then I inserted it into my real code but got an error Here is a snippet of the real code: ================================= If recordCounter = 8 Then ActiveWindow.SelectedSheets.HPageBreaks.Add Befo=ActiveCell 'Sheets("output").Cells(rowNum, colNum).Value="TEXT TEST" recordCounter = 0 End If =========================================== I know the rest of the code except for the HPageBreak statement is good since I tested it before pasting the statement in...I tested it using the "TEXT TEST" and it did insert sample text..but instead of inserting sample text at Cell location (rownum, colNum) I want to insert a page break... Any suggestions...thanks much for any help with this!!! Craig |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Excel 2007 Page Break Adjustments causes a page break each cell | Excel Worksheet Functions | |||
Excel: How do you insert an automatic page break after each row? | Excel Discussion (Misc queries) | |||
Excel 2003 SP2 - Insert | Page Break doesn't work | Excel Discussion (Misc queries) | |||
Automatically insert page break every 6 rows in excel doc | Excel Discussion (Misc queries) | |||
Insert Page Break | Excel Discussion (Misc queries) |