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

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.

883 456789 john wayne 2.25 25.00
883 123456 john wayne 1.75 22.50

-------------------------------------------------
*** 47.50
--------------------------------------------------

887 789123 Steven Segal 3.45 34.50
887 345678 Steven Segal 4.45 44.50

I would like to see the line when column "A" changes, but after space and
after total.

--
yepidu
Reply
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
automatic page break Randy Excel Discussion (Misc queries) 1 March 9th 10 06:49 PM
macro and automatic page break yepidu Excel Discussion (Misc queries) 3 November 3rd 09 09:18 PM
Excel-page break automatic brookse Excel Discussion (Misc queries) 1 June 22nd 09 04:23 PM
Cannot move an automatic page break financialsecretary Excel Discussion (Misc queries) 3 July 25th 07 05:06 PM
Automatic page break 0124 Excel Programming 2 April 4th 05 08:59 PM


All times are GMT +1. The time now is 03:37 AM.

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

About Us

"It's about Microsoft Excel"