Gruppe
Druck
Problem
Wenn ich eine Mehrbereichsauswahl drucke, verwendet Excel für jeden Bereich eine Seite, obwohl alle Bereiche auf einer Seite Platz fänden. Wie kann ich das ändern?
StandardModule: basMain
Sub MehrBereichsDruck()
Dim wksSource As Worksheet, wksTarget As Worksheet
Dim rng As Range
Dim iRow As Integer, intRng As Integer
Application.ScreenUpdating = False
Set wksSource = ActiveSheet
Set wksTarget = Worksheets.Add
wksSource.Select
iRow = 1
With wksTarget
For Each rng In Selection.Areas
intRng = intRng + 1
.Cells(iRow, 1) = "Bereich Nr. " & intRng
rng.Copy
.Cells(iRow + 2, 1).PasteSpecial Paste:=xlValues
iRow = .Cells.Find("*", Range("A1"), , , _
xlByRows, xlPrevious).Row + 2
Next rng
.Columns.AutoFit
.PrintPreview
Application.DisplayAlerts = False
.Delete
Application.DisplayAlerts = True
End With
End Sub