![]() |
![]() |
|
|||||||
| Excel Questions All Excel/VBA questions - formulas, macros, pivot tables, general help, etc. Please post to this forum in English only. |
![]() |
|
|
Thread Tools | Display Modes |
|
|
#1 |
|
New Member
Join Date: Apr 2002
Location: Dublin, Ireland
Posts: 10
|
I'm trying to split up a sheet using page breaks:
Sub PageBreaker() Dim rFound As Range Set rFound = Cells.Find("Marker", LookIn:=xlValues) If Not rFound Is Nothing Then firstAddress = rFound.Address Do With rFound.EntireRow ActiveWindow.SelectedSheets.HPageBreaks.Add Before:=rFound.Offset(3, 0) End With Set rFound = Cells.FindNext(rFound) Loop While Not rFound Is Nothing And rFound.Address <> firstAddress End If End Sub and that's working fine ! But when I add the following code in the innermost with statement to create a row where I can add column headers the whole thing goes into a continuous loop : rFound.EntireRow.Insert If I get this working how do I add the same text in the header rows. Something like this?? But how do I work it for each newly inserted row?? Range("B*").Select ActiveCell.FormulaR1C1 = "Column B" I don't know how to get the cell references right. Please Help !!!!!!!! |
|
|
|
|
|
#2 |
|
Board Regular
Join Date: Mar 2002
Location: Cincinnati, Ohio, USA
Posts: 6,824
|
Hi
Post is trash... My post was Tom [ This Message was edited by: TsTom on 2002-04-23 02:10 ] |
|
|
|
![]() |
| Bookmarks |
| Thread Tools | |
| Display Modes | |
|
|