Hello,
I am having a very difficult time finding a way to have a macro select the printer to used based on a cell value. Basically I have 2 printers setup & installed on my computer. I am looking for the macro to select "printer A" if cell A9 =1. If cell A9=2 then I want it to select "printer B". I have the rest of the code written to select the print areas and print copies based on a cell value but selecting the printer is the last step I am having difficulty with. Below is my current code without the select correct printer:
Sub Macro1()
'
' Macro1 Macro
'
'
Sheets("Label").Select
If Sheets("Label").Range("D9") = 1 Then
ActiveSheet.PageSetup.PrintArea = "$B$19:$J$29"
End If
If Sheets("Label").Range("D9") = 2 Then
ActiveSheet.PageSetup.PrintArea = "$B$32:$J$42"
End If
ActiveWindow.SelectedSheets.PrintOut Copies:=Range("F17").Value, Collate:=True, _
IgnorePrintAreas:=False
Sheets("Home Screen").Select
Range("B4").Select
Selection.ClearContents
Range("B3").Select
Selection.ClearContents
Range("B2").Select
Selection.ClearContents
End Sub
Any help would be greatly appreciated.
Thanks
I am having a very difficult time finding a way to have a macro select the printer to used based on a cell value. Basically I have 2 printers setup & installed on my computer. I am looking for the macro to select "printer A" if cell A9 =1. If cell A9=2 then I want it to select "printer B". I have the rest of the code written to select the print areas and print copies based on a cell value but selecting the printer is the last step I am having difficulty with. Below is my current code without the select correct printer:
Sub Macro1()
'
' Macro1 Macro
'
'
Sheets("Label").Select
If Sheets("Label").Range("D9") = 1 Then
ActiveSheet.PageSetup.PrintArea = "$B$19:$J$29"
End If
If Sheets("Label").Range("D9") = 2 Then
ActiveSheet.PageSetup.PrintArea = "$B$32:$J$42"
End If
ActiveWindow.SelectedSheets.PrintOut Copies:=Range("F17").Value, Collate:=True, _
IgnorePrintAreas:=False
Sheets("Home Screen").Select
Range("B4").Select
Selection.ClearContents
Range("B3").Select
Selection.ClearContents
Range("B2").Select
Selection.ClearContents
End Sub
Any help would be greatly appreciated.
Thanks