Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Printing based on UserForm Selections

Status
Not open for further replies.

Hornet2433

Technical User
Jul 23, 2003
8
0
0
US
I am a newbie programmer with VBA, I am trying to allow a user to print certain sheets from a workbook, depending on which sheets they want. I have created a UserForm with all of the different worksheets as options to click, and finally have a command button that would ideally initialize the print spooling of the corresponding sheets. I have attempted to create a code or to but to no avail, does anyone have any code suggestions for the 'print' button that will execute the printing of the appropriate sheets? Thanks in advance.
 
worksheets("Sheet1").Printout, as you get to the fullstop VB will give you the options you can use with the "Object".

Adrian
 
sorry,
think you may have to put the focus on the worksheet first, try:

Application.ScreenUpdating = False
UserForm1.Hide
Worksheets("Sheet1").Activate
Worksheets("Sheet1").PrintOut
UserForm1.Show
Application.ScreenUpdating = True

works ok for me, let me know how you go

Adrian
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top