B
BLW
I have written this macro to set page breaks once all info is added to the
spreadsheet. Is there anyway to have the Macro run automatically when the
user prints or previews? Or is it better is attach it to a button for them
to click before printing?
Thanks for any help - BLW
Sub PageBreak()
Range("A1").Select
Do While ActiveCell.Value <> "End"
ActiveCell.Offset(20, 0).Select
value1 = ActiveCell.Value
If value1 = "ReMax" Then
ActiveCell.EntireRow.Select
ActiveWindow.SelectedSheets.HPageBreaks.Add Before:=ActiveCell
Else
Do While ActiveCell.Value = ""
ActiveCell.Offset(1, 0).Select
value1 = ActiveCell.Value
If value1 = "ReMax" Then
ActiveCell.EntireRow.Select
ActiveWindow.SelectedSheets.HPageBreaks.Add Before:=ActiveCell
End If
Loop
End If
Loop
End Sub
spreadsheet. Is there anyway to have the Macro run automatically when the
user prints or previews? Or is it better is attach it to a button for them
to click before printing?
Thanks for any help - BLW
Sub PageBreak()
Range("A1").Select
Do While ActiveCell.Value <> "End"
ActiveCell.Offset(20, 0).Select
value1 = ActiveCell.Value
If value1 = "ReMax" Then
ActiveCell.EntireRow.Select
ActiveWindow.SelectedSheets.HPageBreaks.Add Before:=ActiveCell
Else
Do While ActiveCell.Value = ""
ActiveCell.Offset(1, 0).Select
value1 = ActiveCell.Value
If value1 = "ReMax" Then
ActiveCell.EntireRow.Select
ActiveWindow.SelectedSheets.HPageBreaks.Add Before:=ActiveCell
End If
Loop
End If
Loop
End Sub