Gruppe
Druck
Problem
Gemäß den Werten in Spalte A sollen die Seitenumbrüche gesetzt werden.
StandardModule: Modul1
Sub SetPageBreaks()
Dim iRow As Integer
iRow = 2
Do Until IsEmpty(Cells(iRow, 1))
If Cells(iRow, 1).Value <> Cells(iRow - 1, 1).Value Then
Cells(iRow, 1).PageBreak = xlPageBreakManual
End If
iRow = iRow + 1
Loop
ActiveSheet.PrintPreview
End Sub