Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 48
Default 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.
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 35,218
Default print labels from userform

...., 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
  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 5,934
Default print labels from userform

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" wrote in message
...
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.


  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 48
Default print labels from userform

On Mar 2, 2:13*pm, Dave Peterson wrote:
..., 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- 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.
  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 489
Default print labels from userform

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

Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Axis labels wrap until print/print preview Rita Brasher[_2_] Charts and Charting in Excel 3 April 14th 10 03:25 PM
Text labels on a Userform Robert Crandal Excel Programming 2 December 10th 09 09:57 AM
can't print data labels - on screen but don't print out Linda Charts and Charting in Excel 1 June 27th 09 07:11 PM
Help with userform labels [email protected] Excel Programming 3 April 23rd 07 09:39 PM
userform labels RobcPettit[_2_] Excel Programming 2 September 1st 06 07:23 PM


All times are GMT +1. The time now is 06:21 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"