ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   selecting qty to print via textbox entry (https://www.excelbanter.com/excel-programming/440129-selecting-qty-print-via-textbox-entry.html)

jeff

selecting qty to print via textbox entry
 
I've been searching for this, but cannot find it.

Simply, I have a userform to generate label printing. User enters the
info, then in textbox4 will give the quantity to print.

All I need is the script that will change the Number of Copies based
on the entry of Textbox4 when the labels are printed.

Much thanks
j.o.

Ryan H

selecting qty to print via textbox entry
 
I'm not sure what you are wanting to print. I assume a sheet. If it's not a
sheet, I would recommend reading about the PrintOut method in the VBA help
section. It would help if you post the code you are using and give specifics
of your application. I also assume this code is located in the userform
module.

Try this line. Hope this helps! If so, let me know, click "YES" below.

Sheets("Sheet1").PrintOut Copies:=TextBox1.Value

--
Cheers,
Ryan


"jeff" wrote:

I've been searching for this, but cannot find it.

Simply, I have a userform to generate label printing. User enters the
info, then in textbox4 will give the quantity to print.

All I need is the script that will change the Number of Copies based
on the entry of Textbox4 when the labels are printed.

Much thanks
j.o.
.


jeff

selecting qty to print via textbox entry
 
On Mar 2, 10:11*am, Ryan H wrote:
I'm not sure what you are wanting to print. *I assume a sheet. *If it's not a
sheet, I would recommend reading about the PrintOut method in the VBA help
section. *It would help if you post the code you are using and give specifics
of your application. *I also assume this code is located in the userform
module. *

Try this line. *Hope this helps! *If so, let me know, click "YES" below.

Sheets("Sheet1").PrintOut Copies:=TextBox1.Value

--
Cheers,
Ryan



"jeff" wrote:
I've been searching for this, but cannot find it.


Simply, I have a userform to generate label printing. User enters the
info, then in textbox4 will give the quantity to print.


All I need is the script that will change the Number of Copies based
on the entry of Textbox4 when the labels are printed.


Much thanks
j.o.
.- Hide quoted text -


- Show quoted text -


This is not the whole sub, but here's what I'm trying to do. I just
need the part that inputs how many copies to print.

'Pastes TextBox1 to Building
Application.Goto Reference:="Building"
Application.Selection.Value = UCase(TextBox1.Text)
Cancel = False

ActiveCell.Offset(2, 0).Range("A1").Select

'Pastes TextBox2 to Customer
Application.Goto Reference:="Customer"
Application.Selection.Value = UCase(TextBox2.Text)
Cancel = False

ActiveCell.Offset(2, 0).Range("A1").Select

'Pastes TextBox3 to Order number
Application.Goto Reference:="OrderNumber"
Application.Selection.Value = UCase(TextBox3.Text)
Cancel = False

ActiveCell.Offset(2, 0).Range("A1").Select

'********here's where I need help. I'm telling it what printer to
print to. All I need is to know how to tell it *********
'how many labels I want. I tried to put in what I thought
might work, but it didn't.
'Need to take value of TextBox 4 to get qty of labels to print
Application.ActivePrinter = "\\abtapa1491\P01VAL149107 on Ne04:"
ActiveWindow.SelectedSheets.PrintOut Copies:=Val(TextBox4.Value),
ActivePrinter:= _
"\\abtapa1491\P01VAL149107 on Ne04:", Collate:=True

Unload UserForm1

Ryan H

selecting qty to print via textbox entry
 
This line doesn't work?

ActiveWindow.SelectedSheets.PrintOut Copies:=Val(TextBox4.Value),
--
Cheers,
Ryan


"jeff" wrote:

On Mar 2, 10:11 am, Ryan H wrote:
I'm not sure what you are wanting to print. I assume a sheet. If it's not a
sheet, I would recommend reading about the PrintOut method in the VBA help
section. It would help if you post the code you are using and give specifics
of your application. I also assume this code is located in the userform
module.

Try this line. Hope this helps! If so, let me know, click "YES" below.

Sheets("Sheet1").PrintOut Copies:=TextBox1.Value

--
Cheers,
Ryan



"jeff" wrote:
I've been searching for this, but cannot find it.


Simply, I have a userform to generate label printing. User enters the
info, then in textbox4 will give the quantity to print.


All I need is the script that will change the Number of Copies based
on the entry of Textbox4 when the labels are printed.


Much thanks
j.o.
.- Hide quoted text -


- Show quoted text -


This is not the whole sub, but here's what I'm trying to do. I just
need the part that inputs how many copies to print.

'Pastes TextBox1 to Building
Application.Goto Reference:="Building"
Application.Selection.Value = UCase(TextBox1.Text)
Cancel = False

ActiveCell.Offset(2, 0).Range("A1").Select

'Pastes TextBox2 to Customer
Application.Goto Reference:="Customer"
Application.Selection.Value = UCase(TextBox2.Text)
Cancel = False

ActiveCell.Offset(2, 0).Range("A1").Select

'Pastes TextBox3 to Order number
Application.Goto Reference:="OrderNumber"
Application.Selection.Value = UCase(TextBox3.Text)
Cancel = False

ActiveCell.Offset(2, 0).Range("A1").Select

'********here's where I need help. I'm telling it what printer to
print to. All I need is to know how to tell it *********
'how many labels I want. I tried to put in what I thought
might work, but it didn't.
'Need to take value of TextBox 4 to get qty of labels to print
Application.ActivePrinter = "\\abtapa1491\P01VAL149107 on Ne04:"
ActiveWindow.SelectedSheets.PrintOut Copies:=Val(TextBox4.Value),
ActivePrinter:= _
"\\abtapa1491\P01VAL149107 on Ne04:", Collate:=True

Unload UserForm1
.



All times are GMT +1. The time now is 08:09 PM.

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