Search TeachExcel.com
TeachExcel.com
TE
Teach Excel MS Office Tutorials Excel Consulting Services Excel Forum
Excel Video Tutorials Excel Tips Free Excel Macros Excel Help Resources Contact TeachExcel
Video Tutorials
  • Free Macros
  • Excel Help Directory
  • Excel 2007 Resources
  • Keyboard Shortcuts
  • Excel Forum
  • Contact/About

Macros
Excel Tutorials For Macros

Print Entire Workbook in Excel


Bookmark and Share

This free excel macro allows you to print the entire workbook in Excel. You can easily set this macro to a button within the spreadsheet and allow users to more easily print the entire workbook or Excel file.
Where to install the macro:  Module

Print Entire Workbook in Excel Macro

Sub Print_Current_Workbook()
'Prints the current active workbook in Excel

ActiveWorkbook.PrintOut

End Sub


Bookmark and Share


How to Install the Macro
  1. Select and copy the text from within the grey box above.

  2. Open the Microsoft Excel file in which you would like the Macro to function.

  3. Press "Alt + F11" - This will open the Visual Basic Editor - Works for all Excel Versions.  Or For other ways to get there, Click Here.

      For Excel Versions Prior to Excel 2007
      Go to Tools > Macros > Visual Basic Editor

      For Excel 2007
      Go to Office Button > Excel Options > Popular > Click Show Developer tab in the Ribbon. Then go to the Developer tab on the ribbon menu and on the far left Click Visual Basic

  4. On the new window that opens up, go to the left side where the vertical pane is located. Locate your Excel file; it will be called VBAProject (YOUR FILE'S NAME HERE) and click this.

  5. If the Macro goes in a Module, Click Here, otherwise continue to Step 8.

    1. Go to the menu at the top of the window and click Insert > Module
    2. Another window should have opened within the Visual Basic Editor's window. Within this new window, paste the macro code. Make sure to paste the code underneath the last line of anything else that is in the window.
    3. Go to Step 8.

  6. If the Macro goes in the Workbook or ThisWorkbook, Click Here, otherwise continue to Step 8.

    1. Directly underneath your excel file called VBAProject(your file's name here), click the Microsoft Excel Objects folder icon to open that drop-down list.
    2. Then, at the bottom of the list that appears, double-click the ThisWorkbook text.
    3. A new window inside the Visual Basic Editor's window will appear. In this new window, paste the code for the macro. Make sure to paste this code underneath the last line of any other code which is already in the window.
    4. Go to Step 8.

  7. If the Macro goes in the Worksheet Code, Click Here, otherwise continue to Step 8.

    1. Directly underneath your excel file called VBAProject(your file's name here), click the Microsoft Excel Objects folder icon to open that drop-down list.
    2. Within the list that appears you will see every worksheet that is in that excel file. They will be listed as such: Sheet1(NAME OF SHEET HERE) and under that will be Sheet2(NAME OF SHEET HERE). Select the sheet in which you want the macro to run and double-click that sheet.
    3. A new window inside the Visual Basic Editor's window will appear. In this new window, paste the code for the macro. Make sure to paste this code underneath the last line of any other code which is already in the window.
    4. Repeat steps b and c for every sheet you want the macro to work in. Putting the macro in one sheet will not enable it for any other sheets in the workbook.
    5. Go to Step 8.

  8. Close the Microsoft Visual Basic Editor window and save the Excel file. When you close the Visual Basic Editor window, the regular Excel window will not close.

  9. You are now ready to run the macro.



Similar Helpful Excel Resources

I Should Be Able To Print Excel An Entire Workbook Doublesided - Excel

View Content
I am trying to print a significantly large Excel workbook and save paper. I
have chosen everything that is required for the printer to do it but must
change the document to pdf in order for it to happen. Very frustrating and
wasteful.

----------------
This post is a suggestion for Microsoft, and Microsoft responds to the
suggestions with the most votes. To vote for this suggestion, click the "I
Agree" button in the message pane. If you do not see the button, follow this
link to open the suggestion in the Microsoft Web-based Newsreader and then
click "I Agree" in the message pane.

http://www.microsoft.com/office/comm...lic.excel.misc


Print Entire Workbook - Excel

View Content
Hello. I've seen many posts about printing a whole workbook, but I am having trouble with this scenario:

I wrote code (see below) to print, but if the user selects "no", I want the options to pre-fill to print the entire workbook. I can't figure out which argument it is, and how to activate it. Thanks

Code:

Sub Print_()
Dim Answer As String
Answer = MsgBox("Use Default Printer?", vbYesNo, "Printer")
If Answer = vbYes Then
Application.ScreenUpdating = False
Sheets("Setup").Visible = False
ActiveWorkbook.PrintOut Copies:=1, Collate:=True
 
Else

Application.ScreenUpdating = False
Sheets("Setup").Visible = False
Application.Dialogs.Item(xlDialogPrint).Show 
 
End If

Sheets("Setup").Visible = True
Sheets("Setup").Select
Application.ScreenUpdating = True

End Sub




Print An Entire Workbook - Excel

View Content
I have multiple sheets on a work book. I would to print the whole work book with out page breaks between each sheet. As at the moment when you print the entire work book each sheet starts on a new page. I want the new sheet to sart directly under the first sheet. Does any one have a solution.

Print Set-up For Entire Workbook - Excel

View Content
I have a workbook that has 17 work sheets. I am wondering if there is a way to set all 17 work sheets to print in Landscape and fit to page without having to go into each sheet and make the settings individually.
What I would like is that all 17 work sheets print in landscape mode - and the contents of each sheet to fit to the page.

Is this possible?

Any help would be appreciated.
Thanks,

Tp

Print Set-up For Entire Workbook - Excel

View Content
I have a workbook that has 17 work sheets. I am wondering if there is a way to set all 17 work sheets to print in Landscape and fit to page without having to go into each sheet and make the settings individually.
What I would like is that all 17 work sheets print in landscape mode - and the contents of each sheet to fit to the page.

Is this possible?

Any help would be appreciated.
Thanks,

Tp

Print Entire Workbook - Excel

View Content
other then VBA is there a way to save a workbook, that when you need to print it, it will print all sheets

I know you can go to print window and check entire workbook, but would like to have it saved that way.

Reason being some employees are not all that computer savy.

Thanks in advance for any help

Print Entire Workbook By Default - Excel

View Content
Hello everyone,
When Excel opens, by default, the Print Active Sheet option is bulleted.
Can someone tell me how to change this setting to Entire Workbook ?

Thanks !

Disabling 'print What - Entire Workbook' - Excel

View Content
Hello, I've been searching hundreds of posts but not found an answer to this. I have a procedure that applies lots of formatting, filters, repaginates and then finally opens the print dialogue box with

Application.Dialogs(xlDialogPrint).Show

What I need it to do is disable / grey out the "Entire workbook" button so that my users can only print out the active sheet. It defaults to active sheet but I just know that someone will change it and get a lot of wasted paper.

According to the help files and other posts, the 'Print what' section is governed by argument 7 but I don't know if this is where to disable an option or what value to pass to do this.

Another option would be to get my procedure to run across all the sheets but this would take quite a bit of time (takes about 30s for one sheet) and the users would think something was wrong even if I popped up a message box telling them it would take a while.

Any guidance on this would be greatly appreciated

Thanks

John

Macro To Print Entire Workbook To Pdf - Excel

View Content
originally posted at Ozgrid yesterday but no avail
http://www.ozgrid.com/forum/showthread.php?t=152918

really need an answer to this now so I'm posting here.

Morning guvnors

problem : I'm trying to automate the task of converting an entire Excel workbook to PDF but having recorded the action I still get a prompt which I don't want (that's quite poetic isnt it, prompt, want)

In native Excel I would just say

FILE ---> PRINT ---> change the printer to "Adobe Pdf"---> print what: Entire Workbook.

The following code does all this perfectly, but the macro recorder doesn't seem to capture Excel prompting me for the destination to save the file. (I don't want Excel to prompt me as the macro will be part of a larger piece of code that goes into each file in a folder and converts it to PDF so the user can leave it and do something else).

I am happy for the PDF to save in the location that Excel suggests so just want to click "Yes". But not sure how to invoke this part of the code. Here is the code I already have (but it doesn't get me past the yes/no prompt)


Code:

ActiveWorkbook.PrintOut Copies:=1, Collate:=True


Any suggestions please!


Maybe even a piece of code that will just click "Yes" to whatever prompt is on the screen?

Force Print Entire Workbook - Excel

View Content
I'm trying to force users to print the entire workbook instead of just the worksheet. I'm familiar with the code: Code:

  ActiveWorkbook.PrintOut Copies:=1, Collate:=True


but where do I put it? I tried putting it in the Workbook_BeforePrint event, but it printed the entire workbook AND the single worksheet.

I'm probably overlooking something simple.

Random Tutorials
Goal Seek Feature in Excel
(Intermediate)
Bond Pricing Calculations for Simple Bonds
         - Future Value, Present Value, Interest Rate, etc.

(Intermediate)
Extract Text from Cells - Intermediate Example
(Intermediate)
IF Statement Introduction & Using Nested IF's
(Easy)
HLOOKUP() Function - Introduction
(Intermediate)
AND(), OR(), and IF() Statements/Formulas
(Intermediate)
Submit Inquiry Here
  • Prices From $10
Name:*
E-mail:*
Request:*
The macro(s) on this page will be sent with the request.
Contact | Privacy Policy | Disclaimer
Copyright© 2012 TeachExcel.com