Gruppe
VBE
Problem
Bei XL8 habe ich beim Druck eines Moduls nicht die Möglichkeit der Randeinstellung. Alle Drucke beginnen am äußersten oberern und linken Rand. Wie kann ich das ändern?
StandardModule: basMain
Sub ModulDrucken()
Dim sTxt As String
Application.ScreenUpdating = False
With ThisWorkbook.VBProject.VBComponents("basMain").CodeModule
sTxt = .Lines(1, .CountOfLines)
End With
sTxt = WorksheetFunction.Substitute(sTxt, vbCr, "")
Workbooks.Add 1
With Range("A1")
.EntireColumn.ColumnWidth = 80
.WrapText = True
.Value = sTxt
.Font.Name = "Courier New"
End With
ActiveSheet.PageSetup.LeftMargin = Application.InchesToPoints(1)
ActiveSheet.PrintPreview
ActiveWorkbook.Close savechanges:=False
End Sub