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.
0
jeff
3/2/2010 3:13:43 PM
excel.programming 6508 articles. 2 followers. Follow

3 Replies
711 Views

Similar Articles

[PageSpeed] 21

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.
> .
> 
0
Utf
3/2/2010 4:11:01 PM
On Mar 2, 10:11=A0am, Ryan H <Ry...@discussions.microsoft.com> wrote:
> I'm not sure what you are wanting to print. =A0I assume a sheet. =A0If it=
's not a
> sheet, I would recommend reading about the PrintOut method in the VBA hel=
p
> section. =A0It would help if you post the code you are using and give spe=
cifics
> of your application. =A0I also assume this code is located in the userfor=
m
> module. =A0
>
> Try this line. =A0Hope this helps! =A0If so, let me know, click "YES" bel=
ow.
>
> Sheets("Sheet1").PrintOut Copies:=3DTextBox1.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:=3D"Building"
    Application.Selection.Value =3D UCase(TextBox1.Text)
    Cancel =3D False

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

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

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

    'Pastes TextBox3 to Order number
    Application.Goto Reference:=3D"OrderNumber"
    Application.Selection.Value =3D UCase(TextBox3.Text)
    Cancel =3D 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 =3D "\\abtapa1491\P01VAL149107 on Ne04:"
    ActiveWindow.SelectedSheets.PrintOut Copies:=3DVal(TextBox4.Value),
ActivePrinter:=3D _
        "\\abtapa1491\P01VAL149107 on Ne04:", Collate:=3DTrue

    Unload UserForm1
0
jeff
3/2/2010 6:18:37 PM
This line doesn't work?

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


"jeff" wrote:

> On Mar 2, 10:11 am, Ryan H <Ry...@discussions.microsoft.com> 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
> .
> 
0
Utf
3/2/2010 8:15:01 PM
Reply:

Similar Artilces:

Combo box list selection based on earlier selection by user
HI, I have a form that has a combo box 1 (Product) that reads a the Product table and has a unique id attached to each product (RO#). There is a second combo box 2 that is RO#. Now what I would like to do is when a user selects a Product in combo box 1, the system should lookup the Product selected from combo box 1 and upload the corresponding RO# in the combo box 2 list. Now I am using both combo boxes as Unbound and in the combo box 2 I have the two columns Product and RO# - in the Criteria row of RO# I have the following: Like IIf([Forms]![xa_f_lookup]![RO#]=" ",[Forms]![x...

Run report on multi selected records.
I try to make a report for a custom entity that works like the Account Summary: let's say that it's Customer's Inquiry Summary for entity Customer's Inquiry I made the report so that I'm able to run the report on Customer's Inquiry Form. But when I select multi records in the list of Customer's Inquiry and run report, only one record is show in one page of the the report. I would like to have the selected records appear in the report with each record on each page. How can I do this? ...

print preview #5
Hi For some of excel data the grid lines disappear in print preview though all grid lines get printed when I print. Wondering why that happens? VBA Starter Do you have a coloured fill. If you do gridlines will not show -- HTH Nick Hodge Microsoft MVP - Excel Southampton, England nick_hodgeTAKETHISOUT@zen.co.uk.ANDTHIS "vbastarter" <vbastarter@discussions.microsoft.com> wrote in message news:64FFB855-8238-4669-9ABB-9500451DE3F4@microsoft.com... > Hi For some of excel data the grid lines disappear in print preview > though > all grid lines get printed when I ...

Can't select objects in Excel 2007
I'm trying to create a form in Excel 2007, and although I can manipulate, copy & paste controls (check boxes, etc) I can't select multiple objects to align them, etc. I've checked on-line help (and have followed the instructions), and other websites, but no one seems to have indicated a problem. It is extremely cumbersome and I need a solution. Any ideas? Thanks in advance, Jim Berglund I know this is about a year too late, but it may help others who have stumbled across this page looking for similar help. On the Home tab, in the Editing group, click Find & Select....

When shading cells using the 'pattern' option, they print in grey.
When trying to print a 'pattern' in cell shading, it prints only as grey-scale solids. Do the patterns not print, or is it "averaging" the pattern into a solid? Printer dpi is 600, and appears as a pattern on Preview. ...

report purchase, a.stock and sold qty
Does anyone know if there is a way to do a report by Purchase qty, Available qty, Sold quantity report it’s should all tougher including the transfer in, transfer out and physical adjustment in a single shot -- regards dkmohanani dear jeff Thanks for respond, YA its need some additional columns but my item moment report not giving the quantity we purchase its showing available quantity and sold stock. not showing whats the qty we purchase and transfer out qty, transferIn qty I need some thing like this Item lookupcode, ItemDescription ,Purchase qty ,sold qty,available qty,tra...

Lot Selection not Showing when I select PO on Receiving Entry
Usually, the Lot selection screen would pop up when I select a PO at the Line Detail of the Receivings Entry, now it does not! And GP will let items post without a lot number! It seems as if a setting has changed. Any ideas anyone? Any help is appreciated. Thanks, R Are you sure the item is marked to track lots? This wiould be set item by item on the Item Maintenance Options window. -- Richard L. Whaley Author / Consultant / MVP 2006-2008 Documentation for Software Users Get our Free Tips and Tricks Newsletter and check out our books at http://www.AccoladePublications.com &q...

Cost of printing a booklet
UK based. Does anyone know an approx cost to get approx 50 page booklet (paperback) published/printed for self use. It would be equivelent to a half size A4 sheet. It would not be elaborate maybe just a reasonable quality picture on the cover and back doesnt have to be glossy. Inside black print only no pictures. thanks There are commercial sites in the UK that will give you a quote, for example: http://www.b2bindex.co.uk/index/Listings/18/page/7/ A Google search http://www.google.com/#hl=en&source=hp&q=uk+commercial+printers&aq=f&aqi=&aql=f&oq=&a...

Printing #4
Version: 2004 Operating System: Mac OS X 10.5 (Leopard) Hi, we have a printer and 4 PC's who are connecting to the printer. One of the PC's has the version 2004 and the other have the version 2008. All the PC's with version 2008 can print of all the printertrays and the pc with version 2004 can only print out tray 3. This is an office problem, because with that pc we can print out all of the tray's when we are using mail/Daylite instead of word/excel. Do someone knows what the problem is? Thanks, Maja The blame for Printing issues of this nature rarely rests with the progr...

Select contact then hangs
Hi, please help. I have a user that when she selects a contact using To: in a new email, after selecting 2, it closes outlook??. Spec is W2kSP4\office2k with all windows updates and office updates installed. Profile has been deleted and re-created, plus i have set up personal folders and moved contacts into there, and set that folder as a default, but makes no difference. Please help. ...

Printing sheet to fit paper
I waste a lot of paper trying to print an Excel 2000 sheet on a piece of paper. I don't mind multiple vertical pages, but I can't stand multiple horizontal pages. Is there any trick I can use to find out if my document can fit so I don't waste paper? Print Preview. Howard Brazee wrote: > I waste a lot of paper trying to print an Excel 2000 sheet on a piece of paper. > > > I don't mind multiple vertical pages, but I can't stand multiple horizontal > pages. > > Is there any trick I can use to find out if my document can fit so I don't waste &...

Selecting rows from various sheets
Hi all, I have several sheets with a few columns in each. One colum in each sheet has a unique value. Most of these unique values are th same in each sheet but not all. Is there any way that I can set up new sheet that will have the unique value in column 1 and th corresponding column values frommeach sheet beside it. For example Sheet 1 aa 1 1 1 bb 2 2 2 cc 3 3 3 Sheet 2 aa 4 4 cc 5 5 Result aa 1 1 1 4 4 bb 2 2 2 cc 3 3 3 5 5 Thanks alot, Sha -- sha ----------------------------------------------------------------------- shav's Profile: http...

can't print in publisher
Whenever I try to print a project, my printer's out of paper light flashes even though I have paper in place. Only happens with publisher, and not in Word, xcel, or any other application? I have tinkered with settings but nothing seems to work. Any suggestions? Thanks group. Bob Try updating your printer drivers. -- JoAnn Paules MVP Microsoft [Publisher] "Bob" <brokerbob51@sbcglobal.net> wrote in message news:kLT9e.1197$fw2.359@newssvr33.news.prodigy.com... > Whenever I try to print a project, my printer's out of paper light flashes > even though I...

select text in Calendar
I'm working on a calendar in Publisher. I'm adding text into a cell by spacing down 1 point, then typing in 8 points. Doing fine until April. At that time, I can only select cells (whole days). It will not let me select the text. Help is no help. Any hints out there. Did I accidentally select something to do this? Bonnie Have you added a picture to the cell or a shape? If you have send it to the back, make the cell no fill and try again. -- Mary Sauer MSFT MVP http://office.microsoft.com/ http://msauer.mvps.org/ news://msnews.microsoft.com "GoBonnieGo" <GoB...

Accessing SQL Server via MFC & ADO
Hello, I currently have two MFC applications that are accessing SQL Server via ADO. Everything works perfectly (it connects to SQL Server and runs the stored procedures and all), the only issue that I seem to be having is that everytime I rebuild and run the application, my firewall comes up saying that my apps need to connect to the net. There is no networking code in either of these apps, so I am guessing that somehow this is caused by me connecting to SQL Server? The server I am connecting to is local (on my machine), and will be local during deployment. My question is, how do I ge...

macro to filter data based on selected data
Hi, I am looking for a macro that requests input of a reference code and then a date and then filters the data in my spreadsheet based on this criteria. I am using excel 2007. Any help with this will be greatly appreciated. You can probably record a macro while doing it manually and then clean it up and add input boxes to ask the question or input your variable in a cell and use that. If all else fails, If desired, send your file to my address below. I will only look if: 1. You send a copy of this message on an inserted sheet 2. You give me the newsgroup and the ...

Link select with a blast
I have Win 7 Home Premium, x64. Quite often, when I select a link, a mouse pointer changes to a palm with a blast. I understand, the palm is the standard mouse pointer for link select, but what is the blast? What it indicates? -- Ilya Zeldes Fort Myers, Florida Hi Ilya, I suspect that this is being caused by a tracking program. Run something like Ad-Aware and see if it indicates a tracking company. If so, you can delete it, however, it might prevent you from accessing that particular website. Dave "Ilya Zeldes" wrote in message news:7A6FF9B1-5512-44...

Select Case in a Change Event
Hi, I am trying to use a worksheet Change Event to trap changes to specific columns. depending on which column is chnaged by the user, the value in another ciolumn will be altered; so, changes in either column O or P will update column Q, changes in either column T or U will update column V and changes in column Z or AA will update column AB. What I can't figure out is the Select Case bit (where I've got the shouted question below). Here's what I've put together, any comments would be much appreciated. Private Sub Worksheet_Change(ByVal Target As Range) ...

Why won't my text shadows show up when I print?
I'm using PPT 2007 and I have placed a drop shadow on some of my text. I can see it in the PPT file and when I view in slide show mode, but when I print to my printer or Acrobat to make a PDF, the shadows don't show up? Any ideas on why this is happening? Go to Office Button | PPT Options and check the option for High Quality Printing. -- Echo [MS PPT MVP] http://www.echosvoice.com What's new in PPT 2010? http://www.echosvoice.com/2010.htm Fixing PowerPoint Annoyances http://tinyurl.com/36grcd PowerPoint 2007 Complete Makeover Kit http://tinyurl.com/32a7nx ...

Select Records based another table...
This may be very elementary, but i can't wrap my brain around it. I have tried to dummy it down as much as i can for myself, with plans of adapting it into something working. I have three tables that look like the following: Tbl 1: ProdID A B C 1 $1 $2 $3 2 $4 $5 $6 3 $7 $8 $9 Tbl 2: RmNum ProdID 1 3 1 2 2 1 2 2 Tbl 3: RmNum Style 1 A 2 C Relationships are: [tbl1 ProdID] ------ [tbl2 ProdID] [tbl2 RmNum] ...

Multi-Select List Box Does Not Retain Selected Items
I created an Outlook Form in 2003. But when I select items in the list box they do not remain select when I select another control on the form. Any suggestions? Did you bind the list box to a keywords field? -- Sue Mosher, Outlook MVP Author of Microsoft Outlook Programming - Jumpstart for Administrators, Power Users, and Developers http://www.outlookcode.com/jumpstart.aspx "kaykay" <anonymous@discussions.microsoft.com> wrote in message news:276dd01c4638d$bd5af590$a501280a@phx.gbl... > I created an Outlook Form in 2003. But when I select > items i...

Red "O" next to Component Item on Assembly Entry
We are having an issue where we post an Assmebly and it shows updated qty for the FG and the components, but the Assembly Entry remains. The odd thing about it is that one of the components now had a red 'O' at the far right of the component item field. I can't find any info on this 'O', though. So, my guess is this posting issue (which has happened on two assmeblies in the last two days) is somehow related to this 'O' character. Also, when we posted the trx again (when it happened the first time) the assembly entry went away, btu everything posted again. ...

Print 1 page
Using Outlook 2007 and Windows XP Having just migrated to Outlook 2007, I am still looking for some of the features. What I cannot seem to find is how to print just "page 1" or "selected text" from an open email. The only option I seem to have is to "print" which gives me the entire email. Sometimes that's more than I really need. I only need page 1. Anyone know where that option is hiding?? "BK" <nospam@nospam.com> wrote in message news:eW8chxKgJHA.564@TK2MSFTNGP03.phx.gbl... > Using Outlook 2007 and Windows XP > > Hav...

VBA
I am very new to VBA and access and have a question regarding a SELECT statement. I am going to run a select (recordset - so I can loop through and process each record) but on my SELECT I want to make sure I return at least 20 rows, otherwise I am going to change my WHERE clause to include more rows. Is there an easy way to do this or do I need to just do an inital SELECT COUNT(*) and then decide which WHERE clause to use?? Do you have an example I can look at? Thank you in advance! AJ On Fri, 14 Dec 2007 17:14:00 -0800, AJ <AJ@discussions.microsoft.com> wrote: I would not first ...

Drop down list quicker selection
We are using Excel 2003 We created a drop down list using the Data\Validation process, which works fine. When the arrow within a cell is clicked on to show the drop down list, how can you quickly select one of the many names in the list just by typing the first character of a name within the list. At the moment, we have to scroll up and down the list to select a particular name, which in itself isn't a problem, but slows down the process of finding the right name. Can the names within the list be alphabetically grouped when inputting the first character from the keyboard, and spee...