View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.misc
Sheeloo[_3_] Sheeloo[_3_] is offline
external usenet poster
 
Posts: 1,805
Default Insert pagebreak when a specific word appears in a column.

Try the macro
Sub insertBreak()
Dim c As Range, s As Long
lastRow = ActiveSheet.Cells(65000, "A").End(xlUp).Row
Range("A1:A" & lastRow).Select
Set c = Selection.Find("Account")
Rows(c.Row).PageBreak = xlPageBreakManual
End Sub

It will insert a break before the first occurence of "Account" on the active
sheet

"Neal" wrote:

Hi,
I am importing a spreadsheet from another application which has the word
"Account" appearing multiple times in the first column.
I would like to create a Macro that will search for each occurance and
insert a page break above the row containing the word.
Not sure if this is possible?
Any help would be greatly appreciated.
Thanks, Neal...