command/code to print several copies of a userform

alcorjr

Active Member
Joined
Dec 29, 2002
Messages
416
Happy New Year to All!!! :p :p

I'm almost sure I have read a previous topic on this subject, but can't find it right now. Could somebody point me in the right direction??

Thanks a bunch. (y)
 

Excel Facts

Workdays for a market open Mon, Wed, Friday?
Yes! Use "0101011" for the weekend argument in NETWORKDAYS.INTL or WORKDAY.INTL. The 7 digits start on Monday. 1 means it is a weekend.
Hi, you can print a userform by using the printform property. If the code is inside the userform you want to print then you can use the Me keyword, otherwise use the userformname as the prefix.

Code:
Private Sub CommandButton1_Click()
Me.PrintForm
End Sub

Note, that some controls dont tend to acurately reflect what you see on the screen when printed. For example you may have a textbox with long text and some of the text may be missing.

Its probably more accurate to do a screen dump into Word and print it. Why do you want to print the userform?
 
Upvote 0
Hi Perry, thanks for your quick reply. In some instances, I dump the info onto an excel worksheet range and print from there. In this occassion, however, I prefer the format obtained from printing the userform itself and that's why I do so.
I have no problems printing from the userform; I use a "print" button on the form itself, with the userform.Printform command.
When I've printed a worksheet range from a userform-placed control, I always like to place a textbox next to the "print" button ,where the number of copies wanted can be input. This textbox loads an integer-type variable which is later used in the Print command, to determine how many copies of the range I need.

The question, is there a code that will allow me to print more than one copy of the userform?


Thanks a lot :wink:
 
Upvote 0
Hi Alcor. Aren't you making life harder than it needs to be? Couldn't you just loop it and be done?

For p = 1 to x : me.printform : next p
 
Upvote 0

Forum statistics

Threads
1,214,650
Messages
6,120,736
Members
448,988
Latest member
BB_Unlv

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top