I'm printing the same Excel file every time, but I don't want to go through the trouble of setting it up every time..."
Have you ever had such an experience? Many people spend a lot of time on Excel printing. Especially in an environment where multiple printers are used, changing print settings is a major hassle.
However, Excel actually has a powerful feature called "macros" that can greatly streamline the printing process.
In this issue, we will show you how to specify a printer and automatically change print settings at the touch of a button. This method will free you from the tedious setup process every time.
Printing sheets with print settings
If you have already set up the print settings on the page and are ready to just press the print button, you can simply enter this code to print.
Sub Print()
ActiveSheet.PrintOut
End Sub
This macro will print the sheet as it was when it was executed.
Specify printer and print
If you want to specify a printer different from the one you normally use for the data to be output this time, you need to switch the print settings each time and output the data, and then re-set the printer to the original printer again.
If these operations are automated with macros, you can work without thinking about switching printers with a single button.
Check the name of the printer to be changed
First, as a preliminary preparation, check the name of the printer to be changed. Change the print settings to the printer you want to change, and then execute the command below.
Sub Confirm Printer Name()
Debug.Print ActivePrinter
End Sub
The printer name of the target printer will then appear in the Immediate window.

*Please refer here for instructions on how to use the Immediate Window.How to display the Immediate Window Excel(Excel) Macro(VBA)
The " shown hereRICOH SP 3700 PS of "on Ne01:" in red.RICOH SP 3700 PSis the name of the printer.
The "on Ne01:" part is the port name and can be ignored.
Include printer change code
Sub Print()
Dim Printer1 As String
Printer1 = Application. 'Remember printer settings
ActiveSheet.PrintOut _
Copies:=1, _
ActivePrinter:="RICOH SP 3700 PS", _
Collate:=True
Application.ActivePrinter = Printer1 'Restore printer settings to default values
Debug.Print ActivePrinter
End Sub
In the red section of the code above, we have added the "RICOH SP 3700 PSPlease include the ".
Now only when you run this macro will the "RICOH SP 3700 PSThe output can now be made from the
Comment