print labels from userform

I'll try this again.

From  Userform1, the user enters info in textboxes 1, textbox2 and
textbox3, then he enters a number in textbox4. The user will then
click the PRINT button on the userform.

the info from textboxes 1-3 are entered on Sheet1.

Here's the code to print this info onto a label, using the recorder.

Application.ActivePrinter = "\\ABTAPA1491\P01VAL149107 on Ne06:"
    ActiveWindow.SelectedSheets.PrintOut Copies:=1, ActivePrinter:= _
        "\\ABTAPA1491\P01VAL149107 on Ne06:", Collate:=True

The only thing I need is to know is how to apply the value from
textbox4 to the middle line above where it says     PrintOut Copies:=1

I want the value of textbox4 to replace the value of 1.
This value will change each time a user runs this.

I know this will probably involve putting the value of textbox4 into
memory, but I don't know the proper syntax for this.

If you know VBA, and understand what I'm asking for, please respond. I
would appreciate it.

Thanks
j.o.
0
jeff
3/2/2010 7:43:34 PM
excel.programming 6508 articles. 2 followers. Follow

4 Replies
1211 Views

Similar Articles

[PageSpeed] 9

...., Copies:=me.textbox4.value, ...

But I'd do some validation to make sure that it was numeric (and made sense)
first.

jeff wrote:
> 
> I'll try this again.
> 
> From  Userform1, the user enters info in textboxes 1, textbox2 and
> textbox3, then he enters a number in textbox4. The user will then
> click the PRINT button on the userform.
> 
> the info from textboxes 1-3 are entered on Sheet1.
> 
> Here's the code to print this info onto a label, using the recorder.
> 
> Application.ActivePrinter = "\\ABTAPA1491\P01VAL149107 on Ne06:"
>     ActiveWindow.SelectedSheets.PrintOut Copies:=1, ActivePrinter:= _
>         "\\ABTAPA1491\P01VAL149107 on Ne06:", Collate:=True
> 
> The only thing I need is to know is how to apply the value from
> textbox4 to the middle line above where it says     PrintOut Copies:=1
> 
> I want the value of textbox4 to replace the value of 1.
> This value will change each time a user runs this.
> 
> I know this will probably involve putting the value of textbox4 into
> memory, but I don't know the proper syntax for this.
> 
> If you know VBA, and understand what I'm asking for, please respond. I
> would appreciate it.
> 
> Thanks
> j.o.

-- 

Dave Peterson
0
Dave
3/2/2010 8:13:27 PM
Assuming the ActivePrinter code is running from the UserForm's code window, 
try replacing this...

Copies:=1

with this....

Copies:=Me.textbox4.Text

-- 
Rick (MVP - Excel)


"jeff" <wpreqq99@yahoo.com> wrote in message 
news:09ea2641-28bf-497a-a6a3-12133e20382b@m27g2000prl.googlegroups.com...
> I'll try this again.
>
> From  Userform1, the user enters info in textboxes 1, textbox2 and
> textbox3, then he enters a number in textbox4. The user will then
> click the PRINT button on the userform.
>
> the info from textboxes 1-3 are entered on Sheet1.
>
> Here's the code to print this info onto a label, using the recorder.
>
> Application.ActivePrinter = "\\ABTAPA1491\P01VAL149107 on Ne06:"
>    ActiveWindow.SelectedSheets.PrintOut Copies:=1, ActivePrinter:= _
>        "\\ABTAPA1491\P01VAL149107 on Ne06:", Collate:=True
>
> The only thing I need is to know is how to apply the value from
> textbox4 to the middle line above where it says     PrintOut Copies:=1
>
> I want the value of textbox4 to replace the value of 1.
> This value will change each time a user runs this.
>
> I know this will probably involve putting the value of textbox4 into
> memory, but I don't know the proper syntax for this.
>
> If you know VBA, and understand what I'm asking for, please respond. I
> would appreciate it.
>
> Thanks
> j.o. 

0
Rick
3/2/2010 8:18:14 PM
On Mar 2, 2:13=A0pm, Dave Peterson <peter...@verizonXSPAM.net> wrote:
> ..., Copies:=3Dme.textbox4.value, ...
>
> But I'd do some validation to make sure that it was numeric (and made sen=
se)
> first.
>
>
>
>
>
> jeff wrote:
>
> > I'll try this again.
>
> > From =A0Userform1, the user enters info in textboxes 1, textbox2 and
> > textbox3, then he enters a number in textbox4. The user will then
> > click the PRINT button on the userform.
>
> > the info from textboxes 1-3 are entered on Sheet1.
>
> > Here's the code to print this info onto a label, using the recorder.
>
> > Application.ActivePrinter =3D "\\ABTAPA1491\P01VAL149107 on Ne06:"
> > =A0 =A0 ActiveWindow.SelectedSheets.PrintOut Copies:=3D1, ActivePrinter=
:=3D _
> > =A0 =A0 =A0 =A0 "\\ABTAPA1491\P01VAL149107 on Ne06:", Collate:=3DTrue
>
> > The only thing I need is to know is how to apply the value from
> > textbox4 to the middle line above where it says =A0 =A0 PrintOut Copies=
:=3D1
>
> > I want the value of textbox4 to replace the value of 1.
> > This value will change each time a user runs this.
>
> > I know this will probably involve putting the value of textbox4 into
> > memory, but I don't know the proper syntax for this.
>
> > If you know VBA, and understand what I'm asking for, please respond. I
> > would appreciate it.
>
> > Thanks
> > j.o.
>
> --
>
> Dave Peterson- Hide quoted text -
>
> - Show quoted text -

Thanks very much. Yeah, I'll make sure on the numeric values, etc.
This is great! Thanks again.
j.o.
0
jeff
3/2/2010 8:20:19 PM
Try this.

Application.ActivePrinter = "\\ABTAPA1491\P01VAL149107 on Ne06:"
ActiveWindow.SelectedSheets.PrintOut Copies:=Val(Me.Textbox4.Value), 
ActivePrinter:= "\\ABTAPA1491\P01VAL149107 on Ne06:", Collate:=True

Hope this helps!  If so, let me know, click "YES" below.
-- 
Cheers,
Ryan


"jeff" wrote:

> I'll try this again.
> 
> From  Userform1, the user enters info in textboxes 1, textbox2 and
> textbox3, then he enters a number in textbox4. The user will then
> click the PRINT button on the userform.
> 
> the info from textboxes 1-3 are entered on Sheet1.
> 
> Here's the code to print this info onto a label, using the recorder.
> 
> Application.ActivePrinter = "\\ABTAPA1491\P01VAL149107 on Ne06:"
>     ActiveWindow.SelectedSheets.PrintOut Copies:=1, ActivePrinter:= _
>         "\\ABTAPA1491\P01VAL149107 on Ne06:", Collate:=True
> 
> The only thing I need is to know is how to apply the value from
> textbox4 to the middle line above where it says     PrintOut Copies:=1
> 
> I want the value of textbox4 to replace the value of 1.
> This value will change each time a user runs this.
> 
> I know this will probably involve putting the value of textbox4 into
> memory, but I don't know the proper syntax for this.
> 
> If you know VBA, and understand what I'm asking for, please respond. I
> would appreciate it.
> 
> Thanks
> j.o.
> .
> 
0
Utf
3/2/2010 8:34:01 PM
Reply:

Similar Artilces:

Can we turn the printing of audit reports off?
I am new to Great Plains, but it seems everytime we do somthing in the program, it wants to print an audit trail report. With the amount of paper this program is wanting to print off I am going to have the tree protesters knocking on my door soon! Can this be turned off? Go to tools --> setup --> posting --> posting and clear the print box for any reports you don't want for each transaction type. "jeremy" wrote: > I am new to Great Plains, but it seems everytime we do somthing in the > program, it wants to print an audit trail report. With the amount...

how do I tell excell 2003 to print sheets back to front?
In excel 97 I could tell printer to start printing from the back page to the front so the job would come off of the printer in the right order. I cannot find that command in excell 2003. Am I overlooking it, or have they changed the command convention to an obscure, hard to understand, jargon. FILE | PRINT... | Click on the PROPERTIES button | PAGE ORDER, i.e. back to front. "goochiepepper" wrote: > In excel 97 I could tell printer to start printing from the back page to the > front so the job would come off of the printer in the right order. I cannot > find that co...

Printing objects on a worksheet
I have a simple macro that sets the pagesetup properties (more or less just the printarea) and then prints the worksheet. Every time I do this two of the objects move - a command button and a spinner; it doesn't matter if the properties are set to print or not, they move over to the left. Is there some property I should be setting to anchor to a cell or something? Regards -- Les Gordon Hi Less http://support.microsoft.com/d�efault.aspx?scid=kb;EN-US;8389�10 Controls move to the left of the worksheet in Microsoft Excel 2002 -- Regards Ron de Bruin http://www.rondebruin.nl &quo...

Why can't I print embedded objects?
I have an HP IQ770 Touch Screen with Vista Home Premium, my printer is an HP Deskjet 1280. I am using Publisher 2007 and everything prints perfectly except any embedded objects such as clip art or tick boxes. My much older machine at work performs these functions perfectly with XP. Pease help, this is driving me to distraction. David Do you have the latest driver for your printer? The driver on the HP web site is time dated July 2007, may be newer than what you have installed. http://h20000.www2.hp.com/bizsupport/TechSupport/SoftwareIndex.jsp?lang=en&cc=us&prodNameId=439174&...

How: Link Word merge document to Quote from 'print quote for custo
In CRM 4.0 we want to do this as sometimes the sales person does minor amendments to word merge document, and if customer looses quote and wants another sent, any member of staff can send them a copy again. Currently the workaround is to save to Word document and then add Note to Quote and then attach Word file manually. Is there a better way than this? ...

hyperlink button on a userform
[excel 2003] I have a userform which has a column of textboxes displaying hyperlink addresses pulled from a vlookup table. The text boxes have the names : txtHyperlink1 txtHyperlink2 txtHyperlink3 I have Command buttons next to these boxes to which I would like to add code such that they call up the web for the listed hyperlink shown in the text boxes. Can anyone help? Hi Roger, try ActiveWorkbook.FollowHyperlink txtHyperlink1.value Regards, Rainer "Roger on Excel" <RogeronExcel@discussions.microsoft.com> schrieb im Newsbeitrag news:E...

Drawing in Print preview document
How do I draw in a clipped window on a MFC print preview? I need this for reports. The report should hold frames (lines), a window for drawing and text and several windows for text only. I tried with SelectClipRgn() but this only selects where not to draw. I want to clip outside a rectangle. What I need is either: a way to Create fixed windows in a print preview or a function whichs sets the Clip so that drawings/text are clipped outside the wanted area. best regards Laurs I don't get it, after you use SelectClipRgn the DC will only draw in the corrdinates that were specified in...

Labels #3
I have a spreadsheet with columns for name, address, city, state and zip. I want to create labels in Word and input the data from the spreadsheet, rather than re-typing. Is that possible? Sure, Look in HELP index and archives (or google search) for mail merge -- Don Guillett SalesAid Software donaldb@281.com "Lisa" <anonymous@discussions.microsoft.com> wrote in message news:E65F4551-8CBC-4888-987B-7168DA166B9F@microsoft.com... > I have a spreadsheet with columns for name, address, city, state and zip. I want to create labels in Word and input the data from the spreadshe...

How do get a picture in publisher to print on only one page?
I have clip art I have downloaded to publisher. It shows on one page when I am working with it but when I go to print the image shows up in the corner of 4 pages. I am a rookie with this so sorry if this sounds too easy. ...

Printed product is not as in print preview.
I designed a 6x4 card using gthe photo tray and photo paper. When I use the print setup page I see the correct preview. But when I print or select print preview from the main tool bar I get 2 pages and my project split. I cannot see to force a wysiwyg type print. I assume you are using Publisher 2007. When you are finished creating your publication... File, Print, On this screen re-setup your publication and printer, there is a print preview on this screen, it should preview correctly and print correctly. Have you tried using one of the Avery US Letter templates? -- Mary Sauer MSFT M...

Locking out printing
Hi all, Is it at all possible to lock out printing on a sheet until a particular cell is entered/check box clicked. I know you can remove certain buttons/toolbars but someone could still press ctrl-p to print the sheet, I'm looking to lock it out entirely. Many thanks for any help. Colin. -- Remove the 'old' to reply to me. If the one cell was on a separate workbook....excel will not print an empty workbook. "Col" wrote: > Hi all, > > Is it at all possible to lock out printing on a sheet until a particular > cell is entered/check box clicked. >...

Bold characters will not print!
For some reason bold characters will not print from Excel. I trie removing and reinstalling and that worked for a little while, but no it's happening again. Any ideas on what could be causing this (viru or something)? Thanks for any help you could give me -- Dragoon_4 ----------------------------------------------------------------------- Dragoon_42's Profile: http://www.excelforum.com/member.php?action=getinfo&userid=2400 View this thread: http://www.excelforum.com/showthread.php?threadid=37627 I just tried printing in another font and that seemed to work. Is there a bu...

how to laminate 10 business cards printed in publisher front and .
I have printed front and back (2 sheets) from Publisher using the Business Card template. They are set up to print 10 per page. When I go to laminate them (the entire sheets), I am unable to make 10 individual laminated cards because where you cut them down the laminate can't help. Any ideas on a work around? Thanks\ Sara Grier Sara Grier wrote: > I have printed front and back (2 sheets) from Publisher using the > Business Card template. They are set up to print 10 per page. When > I go to laminate them (the entire sheets), I am unable to make 10 > individual lamina...

Publisher 2003
Hi, I'm trying to create a membershipcard with publisher. I used a mail merge to create all the cards with different names and picuters. On the screen everything looks fine. I want to have multiple cards on one page with a total of eight per page. When looking at the print preview every card shows the same name. I read about the bug with the preview so I printed some pages. Now I get a page full of cards with the same name and then a page with the second name in all the cards and so on. What am I doing wrong? Maarten Maarten <rijt@dse.nl> was very recently heard to utter: ...

Won't print color
Savin 4540..checked all known areas..wont print color..just black and white. Preview is color..settings are color..hint..it once printed color..then stopped after saving the file. I have windows xp. Help? Check out a new driver, there is a driver with a time stamp of December 2007, maybe newer than yours. http://www.savin.com/downloads/Default.aspx?hbn=drivers -- Mary Sauer MSFT MVP http://office.microsoft.com/ http://msauer.mvps.org/ news://msnews.microsoft.com "CraigO" <CraigO@discussions.microsoft.com> wrote in message news:E97BD54B-D9DA-40C0-9F0C-6F8CFD90EA1B@micros...

Receipt intermittently not printing
Customer has ver. 2.0 RMS Store Ops. Database is on a server and there is one POS machine, with 4 back office machines. This was an upgrade from QS2000. We upgraded straight into ver. 2.0 so are running SQL 2005 Server Express. No MSDE installed. Using Epson TM88 printer w/USB connection and Epson OPOS driver. Database upgraded fine, although there was one issue (wrong data in the sale date field) which we solved prior to importing the database into RMS. Not long after initial use of RMS, we started having issues with receipts intermittently not printing. When we investigated we foun...

Fit-to-page print option malfunctions
With great frequency, Excel 2007 shrinks a worksheet much more than it needs to fit on the page. This results in a printout that is too small and a lot of wasted blank space on the page. In turn, this forces us to manually specify a scaling percentage that is much larger, yet still lets the worksheet fit on a page. This has been a problem for us for many years and many versions, does anyone know why? Please note that we have deleted rows beneath the data and columns to the right of the data to be sure there is no extraneous data hiding outside the confines of the printed worksheet. ...

Publisher 2000 won't print on all printers
Hi, We having problems with printing using Microsoft Publisher 2000. There are 3 printers on the network: 1 Epson 710 2 Hewlett Packard CP1700 3 Minolta Laser Jet Publisher 2000 won't see the the HP printer. It prints on the all other printers and all other applications can print on that HP. All patches and updates have also been added - Can anyone help? You do have the latest drivers, right? HP has a driver for your printer with a timestamp of January 2004... Firmware too. I am assuming a XP OS http://www.hp.com/country/us/en/support.html -- Mary Sauer MS MVP http://office.m...

How do I customize data labels
I want to customize my data labels. I don't want them to be the values of the bar graphs. I don't want to include the data that I want to be the labels because then it will show up as bar chart. Example I am graphing averages and I want the N to be the lables but I don't need the N to be in a graph. On Thu, 23 Aug 2007, in microsoft.public.excel.charting, Allison <Allison@discussions.microsoft.com> said: >I want to customize my data labels. I don't want them to be the values of the >bar graphs. I don't want to include the data that I want to be the labels...

Printing problem on a terminal server
Hi, I created an application that does some printing with MFC (7.1). When I do a print preview or I print, every thing works fine. However, when I try to do a print preview or if I try to print from within terminal server, then all the fonts are very small (they look like 1pt high). What am I doing wrong (or what should I do)? This is a sample of my code LOGFONT font; ::ZeroMemory(&font, sizeof(font)); _tcscpy(font.lfFaceName, _T("Courier New")); font.lfHeight = -MulDiv(75, pDC->GetDeviceCaps(LOGPIXELSY), 2540); // 7.5 pts font.lfWidth = 0; font.lfEscapement = 0; font.lfOr...

Printing in AxWebBrowser
Hi guys. I have a problem printing from AxWebBrowser. If I print from a button the printing is ok, but if i want to print automatically (when the document is loaded) then i have a problem, it seems that it never gets the state READYSTATE_COMPLETE but is in the state READYSTATE_LOADING all the time. I even use a do {} while but it never gets the state READYSTATE_COMPLETE. Best Regards, Mystique ...

Email Printing
I have a user with WinXP using OL2002. He can print his email messages fine if the sender used Plain Text or Rich Text but if the sender uses the HTML format when he prints the email is cutoff on the lefthand side during printing. Almost looks like the first character of each sentence is missing using HTML. Any help would be greatly appreciated. ...

remove Print Display
Version: 2008 Operating System: Mac OS X 10.6 (Snow Leopard) I can not remove the Big Blue Print Display words pasted on my xcel sheet. When I save and send to others it is still there, making it difficult to read text There is nothing in Excel that would cause anything like what you've briefly described to occur by default. It would have to explicitly have been created by someone working in the file. With no more detail than you've provided though there are only 2 possibilities that come to mind. The first is that someone has added some sort of graphic or text to the Hea...

Printing Command Button problems
When I print a worksheet with a command button, the button slides over when I hit print. It doesn't matter if Print object is enabled or not. xl2002? This might be it: http://support.microsoft.com/default.aspx?scid=kb;EN-US;838910 Controls move to the left of the worksheet in Microsoft Excel 2002 don't know enough wrote: > > When I print a worksheet with a command button, the button > slides over when I hit print. It doesn't matter if Print > object is enabled or not. -- Dave Peterson ec35720@msn.com ...

Printing calendar in report
I am looking at how to print a calendar in a report. I am needing an one year calendar which I can do with by inserting 12 calendar controls and updating the month and year, etc. Is there a way to streamline this operation? 2 other questions concerning the calendar. Is there a way to shorten the DayLength to where only the first letter of the day shows? (ie. S M T W T F S). To get the whole year on the page it needs to be fairly small and the SUN, MON, TUE, etc. all runs together. Jeff On Sat, 07 Apr 2007 02:12:44 GMT, "prairiewind" <u33121@uwe> wrote: >I am looking...