Dim
strPrinter
As
String
Dim
intPrintFrom
As
Integer
Dim
intPrintTo
As
Integer
Dim
intCopies
As
Integer
With
Worksheets(
"Evaluationsbogen"
)
intPrintFrom = 1
intPrintTo =
CInt
(.Range(
"I2"
).Value)
intCopies = 1
strPrinter =
"\\Drucker1 auf Ne1:"
End
With
If
intPrintTo < intPrintFrom
Then
Call
MsgBox( _
"Seitenzahl ist ungültig! ([from("
& intPrintFrom &
")], [to("
& intPrintTo &
")])"
, _
vbExclamation)
Exit
Sub
End
If
Dim
strPrinterOld
As
String
strPrinterOld = Application.ActivePrinter
Application.ActivePrinter = strPrinter
Call
ActiveSheet.PrintOut( _
From:=intPrintFrom, _
To
:=intPrintTo, _
Copies:=intCopies, _
Preview:=
False
, _
ActivePrinter:=strPrinter, _
Collate:=
True
)
Application.ActivePrinter = strPrinterOld