Reputation:
I have a button in excel and I want it to print an X amount of copies. Like Say 10 so items come into stock. I want to print 10 copies. I have formula that looks up the item info. I just want a code that Prints so many times for the "quantity" that I will fill in.
Upvotes: 0
Views: 10856
Reputation: 19367
Essentially..
Sub PrintXCopies()
ActiveSheet.PrintOut , , Range("A1").Value
End Sub
where the number of copies to print is in cell A1. You should add error-handling in case this is not a number, or a sensible number. Something like:
Sub PrintXCopies()
If IsNumeric(Range("A1").Value) Then
If Range("A1").Value >= 1 And Range("A1").Value < 10 Then
ActiveSheet.PrintOut , , Range("A1").Value
End If
End If
End Sub
Upvotes: 1