dim sh as Worksheet
for each sh in thisworkbook.worksheets
if sh.Cells(1, 1).value = "Drucken" then sh.printout 'oder Export als PDF
next
dim sh as worksheet
dim check as boolean
check =true
for each sh in thisworkbook.worksheets
if sh.Cells(1, 1).value = "Drucken" then
sh.Select check
check = false
end if
next
ActiveWindow.selectedSheet.printout
dim txt as string
if Range("A1") = "Drucken" then txt = txt & ",A1:X100"
if Range("A101") = "Drucken" then txt = txt & ",A101:X200"
if Range("A201") = "Drucken" then txt = txt & ",A201:X300"
if Range("A301") = "Drucken" then txt = txt & ";A301:X400"
ActiveSheet.PageSetup.PrintArea = Mid(txt, 2)
ActiveSheet.PrintOut
Sub DruckeMarkierteSeiten()
Const k = 3 'Zeilen pro Druckseite
Dim i As Long
With Worksheets("Druckvorlage")
For i = 1 To 4
.Rows(i * k - k + 1).Resize(k).Hidden = (.Cells(i * k - k + 1, 3).Value <> "Drucken")
Next i
.Cells.SpecialCells(xlCellTypeVisible).PrintOut Preview:=True
.Rows.Hidden = False
End With
End Sub
Sub M_snb()
For Each it In Columns(3).SpecialCells(2).Areas
it.Offset(, -2).Resize(3, 3).PrintOut
Next
End Sub
Sub DruckeMarkierteSeiten()
Const k As Long = 3 'Zeilen pro Druckseite
Dim i As Long
With Worksheets("Druckvorlage")
For i = 1 To 4 'Schleife durch Druckseiten
.Rows(i * k - k + 1).Resize(k).Hidden = (.Cells(i * k - k + 1, 3).Value <> "Drucken")
Next i
On Error Resume Next
.Rows(1).Resize((i - 1) * k).SpecialCells(xlCellTypeVisible).PrintOut Preview:=True
If Err Then MsgBox "Es wurde keine Auswwahl getroffen!", vbInformation
On Error GoTo 0
.Rows.Hidden = False
End With
End Sub
dim txt as string
if Range("A1") = "Drucken" then txt = txt & ",A1:X100"
if Range("A101") = "Drucken" then txt = txt & ",A101:X200"
if Range("A201") = "Drucken" then txt = txt & ",A201:X300"
if Range("A301") = "Drucken" then txt = txt & ";A301:X400"
ActiveSheet.PageSetup.PrintArea = Mid(txt, 2)
ActiveSheet.PrintOut
Replace(Thisworkbook.Fullname, ".pdf", "")