Need button "PRINT"

sporitus

New Member
Joined
Jan 23, 2009
Messages
34
Dear Experts:

Fot our girls I need to have the button "PRINT".
When someone press it, whole document is printing.

Please advice, ho to do this button on Excel table.

thanks
 

Excel Facts

Copy PDF to Excel
Select data in PDF. Paste to Microsoft Word. Copy from Word and paste to Excel.
Try

Code:
Sub prt()
Dim ws As Worksheet
For Each ws In ThisWorkbook.Worksheets
    ws.PrintOut
Next ws
End Sub
 
Upvote 0
By "whole document is printing" do you mean all worksheets in the workbook or just all pages of the active worksheet?

This will print all pages of the active worksheet:
Code:
ActiveSheet.Printout
This will print all worksheets in the workbook:
Code:
ActiveWorkbook.Printout
 
Upvote 0
Press ALT + F11 to open the Visual Basic Editor, Insert > Module and paste the code into the white space on the right.

Press ALT + F11 to return to your sheet, add a button from the Forms toolbar and assign it to the macro.
 
Upvote 0
VoG;

Thanks a lot. it looks like work.

Could you advice how to make some sheets unprintable when i push print whole workbook ?
 
Upvote 0
Try this

Code:
Sub prt()
Dim ws As Worksheet
For Each ws In ThisWorkbook.Worksheets
    If ws.Name <> "2007" And ws.Name <> "2008" And ws.Name <> "2009" Then ws.PrintOut
Next ws
End Sub
 
Upvote 0

Forum statistics

Threads
1,214,606
Messages
6,120,487
Members
448,967
Latest member
visheshkotha

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