A family of Microsoft spreadsheet software with tools for analyzing, charting, and communicating data.
Assuming you have inserted a module containing the code from Chip's site, you could put it to use like so:
Sub printReport()
'
' printReport Macro Testing
'
Const RxPrinter As String = "RxPrinter on Ne00"
Const PDFCreator As String = "PDFCreator"
Const deskPDF As String = "deskPDF"
Const EPSON As String = "EPSON NX125 NX127 Series"
Dim sPrinters() As String
Dim lCt As Long
'Get a list of all printers with their ports
sPrinters = GetPrinterFullNames
Loop through the list of printers until a matching name is found:
For lCt = LBound(sPrinters) To UBound(sPrinters)
If sPrinter(lCt) Like RxPrinter & "*" Then
'Found one...
Print Application.ActivePrinter = sPrinters(lCt)
'Application.ActivePrinter = PDFCreator
'Application.ActivePrinter = deskPDF
ActiveWindow.SelectedSheets.PrintOut Copies:=1, Collate:=True, _
IgnorePrintAreas:=True
Exit For
End If
Next
End Sub