LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 20
Default Page break code - hpagebreak before value

Need to have a page break before every instance of *dept* in a column... this
doesn't work. Do multiple columns mess it up?

Cells.PageBreak = xlPageBreakNone
col = 1
LastRw = 3300
For x = 1 To LastRw
If Cells(x, col).Value = "*dept*" Then 'or like "*dept*"
ActiveWindow.SelectedSheets.HPageBreaks.Add Befo=Rows(x)
End If
Next
ActiveWindow.View = xlPageBreakPreview
'ActiveSheet.ResetAllPageBreaks
End Sub
 
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 2007 Page Break Adjustments causes a page break each cell BKaufman Excel Worksheet Functions 2 September 10th 10 05:02 AM
Page break code [email protected] Excel Programming 2 July 9th 09 08:35 PM
VBA Code-listing page break John Wolcott Excel Programming 4 November 1st 08 02:34 AM
HPageBreak count problem unless in page break view Tim Zych[_8_] Excel Programming 3 August 5th 04 11:54 PM
Code to insert a Page Break Moore Excel Programming 2 August 6th 03 04:37 PM


All times are GMT +1. The time now is 11:06 AM.

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"