Macro print quantity

I have the below macro to print an excel sheet to a specific printer.

Sub MyPrint2()
Dim sCurrentPrinter As String
Const MyPrinter As String = "\\hv-pc02\Zebra  Z4M (200dpi) on Ne03:"
sCurrentPrinter = Application.ActivePrinter
Application.ActivePrinter = MyPrinter
ActiveSheet.PrintOut '
Application.ActivePrinter = sCurrentPrinter
End Sub

Open in new window

How would I addi in the ability to change the print quantity based a specific cell?
RichardAtkAsked:
Who is Participating?
 
Rgonzo1971Commented:
H(I,

pls try
Sub MyPrint2()
Dim sCurrentPrinter As String
Const MyPrinter As String = "\\hv-pc02\Zebra  Z4M (200dpi) on Ne03:"
sCurrentPrinter = Application.ActivePrinter
Application.ActivePrinter = MyPrinter
ActiveSheet.PrintOut Copies:=Range("A1").Value
Application.ActivePrinter = sCurrentPrinter
End Sub

Open in new window

Regards
0
 
RichardAtkAuthor Commented:
Hi

I get the error message Run-time error '1004':
0
 
Rgonzo1971Commented:
is the value in Cell A1?
0
 
RichardAtkAuthor Commented:
Working now. I had the Macro in the wrong sheet.

Thank you
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.