selecting qty to print via textbox entry

J

jeff

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.
 
R

Ryan H

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
 
J

jeff

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








- 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
 
R

Ryan H

This line doesn't work?

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

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

Top