I am trying to get Excel to go down my spreadsheet and every time a cells contains "- - - - - - - - - - " that should trigger a page break. I just can't seem to figure this out.
Here is what I have.....
Thanks for any help.
Here is what I have.....
VBA Code:
Sub createit()
Dim xxx As Worksheet
Set xxx = Worksheets("xxx")
lastrow = xxx.Range("a" & Rows.Count).End(xlUp).Row
For i = 1 To lastrow
If Left(xxx.Cells(i, 1), 10) = " - - - - -" Then ' add page break
Worksheets("xxx").Rows(i).PageBreak = xlPageBreakManul
End If
Next i
End Sub
Thanks for any help.