ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Printing VBA (https://www.excelbanter.com/excel-programming/317661-printing-vba.html)

TyeJae[_25_]

Printing VBA
 

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


--
TyeJae
------------------------------------------------------------------------
TyeJae's Profile: http://www.excelforum.com/member.php...fo&userid=7233
View this thread: http://www.excelforum.com/showthread...hreadid=319976


Dave Peterson[_5_]

Printing VBA
 
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

TyeJae wrote:

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

--
TyeJae
------------------------------------------------------------------------
TyeJae's Profile: http://www.excelforum.com/member.php...fo&userid=7233
View this thread: http://www.excelforum.com/showthread...hreadid=319976


--

Dave Peterson


All times are GMT +1. The time now is 10:57 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com