LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 7
Default macro and automatic page break

I need to insert a page break when 2 conditions are met.

I currently have:
Sub PageBreak()
Dim IngRow As Long
For IngRow = 2 To Cells(Rows.Count, "D").End(xlUp).Row + 1
If Range("D" & IngRow) < Range("D" & IngRow - 1) Then
ActiveSheet.HPageBreaks.Add Befo=Range("F" & IngRow)
End If
Next

End

But I also need consider if column F is greater than 0, insert page break
after row

--
yepidu
 
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
Excel-page break automatic brookse Excel Discussion (Misc queries) 1 June 22nd 09 04:23 PM
Excel: How do you insert an automatic page break after each row? tjw Excel Discussion (Misc queries) 1 January 15th 08 10:21 PM
Cannot move an automatic page break financialsecretary Excel Discussion (Misc queries) 3 July 25th 07 05:06 PM
Can I set an automatic page breaks to break every 40 lines? Kennbu Excel Discussion (Misc queries) 1 June 15th 06 05:59 PM
Using macro for page break Sara Excel Discussion (Misc queries) 2 January 13th 05 09:29 PM


All times are GMT +1. The time now is 01:36 PM.

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

About Us

"It's about Microsoft Excel"