habe folgenden Code einer Box, die alle Blätter der Mappe auflistet und zum Drucken in eine Box aufführt. Möchte den Code nun so erweitern, dass er ab einem bestimmten Blatt nur die Blätter aufnimmt, die ab Zeile 11 mit Inhalt gefüllt sind (also A11 <> "" würde reichen!). Kann da jemand weiterhelfen?
Grüße, Sebastian
Private Sub UserForm_Initialize()
Dim ws As Worksheet
For Each ws In Worksheets
ListBox1.AddItem ws.Name
Next ws
ListBox1.MultiSelect = fmMultiSelectMulti
End Sub
Private Sub PrintBtn_on_UserForm_Click()
Dim i%
Dim BoAntwort As Boolean
BoAntwort = Application.Dialogs(xlDialogPrinterSetup).Show
If BoAntwort = False Then Exit Sub
With ListBox1
For i = 0 To .ListCount - 1
If .Selected(i) = True Then Worksheets(.List(i)).PrintOut
Next i
End With
DruckBox.Hide
End Sub