Hi
I'm having a problem with a little piece of vba that I'm using. Basically what I want this to do is insert a page break every 37 rows starting at row 48 and ending at row 2138. What happens is it starts at row 37 and then adds a pagebreak every 37 rows, ignoring the starting range I set for it (A48) but still completing at my finishing range (A2138). I've tried changing the start range to numberous values but cannot seem to find any reason to it.
Sub AddPageBreak()
interval = 37
For Each Cell In Range("A48:A2138")
n = n + 1
If n Mod (interval + 1) = 0 Then
Worksheets("Tech").Rows.PageBreak = xlPageBreakManual
End If
Next Cell
End Sub
Any suggestions??
I'm having a problem with a little piece of vba that I'm using. Basically what I want this to do is insert a page break every 37 rows starting at row 48 and ending at row 2138. What happens is it starts at row 37 and then adds a pagebreak every 37 rows, ignoring the starting range I set for it (A48) but still completing at my finishing range (A2138). I've tried changing the start range to numberous values but cannot seem to find any reason to it.
Sub AddPageBreak()
interval = 37
For Each Cell In Range("A48:A2138")
n = n + 1
If n Mod (interval + 1) = 0 Then
Worksheets("Tech").Rows.PageBreak = xlPageBreakManual
End If
Next Cell
End Sub
Any suggestions??