Printing VBA

  • Thread starter Thread starter TyeJae
  • Start date Start date
T

TyeJae

I have cell that I named "Quantity". There is a formula in that cell
that tells me the quantity of sheets that I need to print according to
some information that I enter. What I want to do is create a button
that will print the amount of sheets according to the number that is in
"Quantity". Is this possible?

Thanks in advance,
TyeJae
 
Maybe something like this will give you an idea:

Option Explicit
Sub testme()

Dim myQtyCell As Range
Dim iCtr As Long

Set myQtyCell = Worksheets("sheet1").Range("Quantity")

If IsNumeric(myQtyCell.Value) Then
If myQtyCell.Value > 0 Then
For iCtr = 1 To CLng(myQtyCell.Value)
Worksheets("sheet2").PrintOut preview:=True
Next iCtr
End If
End If
End Sub
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top