Hi
I have a code as below that first records the details of current active printer, then changes the active printer to a different network printer, and then switches back to a original printer.


Sub final_printer_VBA()
Dim STDprinter As String

'---VVV---- record the details of default printer
STDprinter = Application.ActivePrinter

'---VVV---- change printer to another network printer. _
'Range("printerDetails").Value refers to a cell that in my scenario contains value "\\APP103VMFLT\FLTPLT012" (without quotes)

'----------------------------------------------------------------VVV----
Application.ActivePrinter = Range("printerDetails").Value & " on Ne03:" '<<< this is where I need help
'----------------------------------------------------------------AAA---_
'How to set up a loop so it would start with Ne01 and on error would loop through to Ne16 if required, until it finds the correct one?


'---VVV---- print dialog box. I will change this to print x 1 copy
Application.Dialogs(xlDialogPrint).Show

'---VVV---- change active printer back to default printer
Application.ActivePrinter = STDprinter

End Sub
I would need a bit of help with
Application.ActivePrinter = Range("printerDetails").Value & " on Ne03:"
namely how can I create a loop with Ne03 so it would loop from Ne01 to Ne16.
E.g.
if it errors with Ne01, then it tries Ne02, if it fails with Ne02 it then tries Ne03, etc, etc.
So lets say the right answer is Ne15, and in this scenario it would have to loop through with Ne01 to Ne14 and on only proceed with the code with Ne15.


Any ideas? As always I would appreciate any help. Cheers.