ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   UserForm Question (https://www.excelbanter.com/excel-programming/290392-userform-question.html)

abxy[_16_]

UserForm Question
 
I'm trying to make a command button on my UserForm to print Sheet1 of
different workbook. How can I do this?

eg, clicking command button1 will print
C:\whatever_my_path_is\[Book1.xsl]Shee

--
Message posted from http://www.ExcelForum.com


Tom Ogilvy

UserForm Question
 
workbooks.open "c:\whatever_my_path_is\Book1.xls"
ActiveWorkbook.Worksheets(1).Printout
Activeworkbook.Close SaveChanges:=False

--
Regards,
Tom Ogilvy

"abxy " wrote in message
...
I'm trying to make a command button on my UserForm to print Sheet1 of a
different workbook. How can I do this?

eg, clicking command button1 will print:
C:\whatever_my_path_is\[Book1.xsl]Sheet


---
Message posted from http://www.ExcelForum.com/




abxy[_17_]

UserForm Question
 
Thanks, this works perfectly!

one last thing though...how would i get it to print out 3 copies?


---
Message posted from http://www.ExcelForum.com/



All times are GMT +1. The time now is 11:13 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com