ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Super Easy - adding a button to print (https://www.excelbanter.com/excel-programming/414642-super-easy-adding-button-print.html)

KenCanuck

Super Easy - adding a button to print
 
I can't figure this out. I just want to add a 'button' next to some text,
that when clicked, will print a specific worksheet. Thanks!

Office_Novice

Super Easy - adding a button to print
 
Sub Command_Button1_Click()
Activesheet.printout
End Sub
"KenCanuck" wrote:

I can't figure this out. I just want to add a 'button' next to some text,
that when clicked, will print a specific worksheet. Thanks!


Susan

Super Easy - adding a button to print
 
oh! i do this all the time...... either to print one specific
worksheet or to print all the worksheets in a workbook.

you add a command button to the worksheet. check the properties &
change "print object" to false.

then add coding such as one of these:

Private Sub CommandButton1_Click()
Worksheets(1).PrintOut
'or Worksheets("Sheet1").PrintOut
End Sub


Private Sub CommandButton1_Click()
'will print them all........
Worksheets.PrintOut
'effectively de-selects the group of worksheets
'by just selecting one of them
Worksheets(1).Select
End Sub

:)
susan



On Jul 25, 2:46*pm, KenCanuck
wrote:
I can't figure this out. *I just want to add a 'button' next to some text,
that when clicked, will print a specific worksheet. *Thanks!




All times are GMT +1. The time now is 08:31 AM.

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