Hey guys,
Simple code, basically selecting a sheet then selecting a printer from control panel and then forcing it to print whatever it's looking at.
Question is how can I avoid the selects?
Best just to:
Set ws = "SheetXYZ"
If Sheets"(SheetXYZ").Range("XYZ") = 1 then
WshNetwork.SetDefaultPrinter "C15015 Printer"
Sheets("SheetXYZ").PrintOut ActivePrinter:="C15015 Printer"
Or do I keep my:
Cheers fellas
Simple code, basically selecting a sheet then selecting a printer from control panel and then forcing it to print whatever it's looking at.
Question is how can I avoid the selects?
Best just to:
Set ws = "SheetXYZ"
If Sheets"(SheetXYZ").Range("XYZ") = 1 then
WshNetwork.SetDefaultPrinter "C15015 Printer"
Sheets("SheetXYZ").PrintOut ActivePrinter:="C15015 Printer"
Or do I keep my:
Code:
Sub PrintToSelectedPrinterC15015()
Sheets("C15015 Machine Batch").Select
Dim WshNetwork
Set WshNetwork = CreateObject("WScript.Network")
If Range("AP3").Value = 1 Then
Sheets("C15015 Label").Select
WshNetwork.SetDefaultPrinter "C15015 Printer"
ActiveSheet.PrintOut ActivePrinter:="C15015 Printer"
'Call movecompletedc15015
End If
End Sub
Cheers fellas