A
andy
A kind person helped me by supplying code for a macro to
insert a page break based on the changing of a value in a
column. It will work on a limited amount of data (~ 3,000
records) but not on my entire file (~10,000 records). Is
there a limit to the amount of pagebreaks you can insert?
This is the code, perhaps someone has another suggestion:
Sub InsertPagebreak()
lastrow = ActiveSheet.Cells(Rows.Count, "B").End(xlUp).Row
For rowindex = lastrow - 1 To 10 Step -1
If Cells(rowindex, "B").Value <> "" Then
If IsNumeric(Cells(rowindex, "B").Value) Then
If Cells(rowindex, "B").Value <> _
Cells(rowindex + 1, "B").Value Then
ActiveSheet.HPageBreaks.Add Before:= _
Cells(rowindex + 1, "B")
End If
End If
End If
Next
End Sub
Thank you in advance
God bless you
insert a page break based on the changing of a value in a
column. It will work on a limited amount of data (~ 3,000
records) but not on my entire file (~10,000 records). Is
there a limit to the amount of pagebreaks you can insert?
This is the code, perhaps someone has another suggestion:
Sub InsertPagebreak()
lastrow = ActiveSheet.Cells(Rows.Count, "B").End(xlUp).Row
For rowindex = lastrow - 1 To 10 Step -1
If Cells(rowindex, "B").Value <> "" Then
If IsNumeric(Cells(rowindex, "B").Value) Then
If Cells(rowindex, "B").Value <> _
Cells(rowindex + 1, "B").Value Then
ActiveSheet.HPageBreaks.Add Before:= _
Cells(rowindex + 1, "B")
End If
End If
End If
Next
End Sub
Thank you in advance
God bless you