Gruppe
Druck
Problem
Alle Seiten sollen mit variablen oberen und unteren Rahmen gedruckt werden.
StandardModule: Modul1
Sub IsPageBreak()
Dim rng As Range
Dim vRowBrk As Variant
Dim lRow As Long
Dim iBreak As Integer
Set rng = Range("A1").CurrentRegion
Cells.Borders.LineStyle = xlLineStyleNone
rng.BorderAround LineStyle:=xlContinuous, Weight:=xlMedium
iBreak = 1
Do
vRowBrk = ExecuteExcel4Macro("INDEX(GET.DOCUMENT(64)," & iBreak & ")")
iBreak = iBreak + 1
If IsError(vRowBrk) Then Exit Do
rng.Rows(vRowBrk - 1).Borders(xlEdgeBottom).Weight = xlMedium
rng.Rows(vRowBrk).Borders(xlEdgeTop).Weight = xlMedium
Loop
ActiveSheet.PrintPreview
Cells.Borders.LineStyle = xlLineStyleNone
End Sub