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 Preview Screen Display for The Entire Workbook in Excel


Bookmark and Share

This free Excel macro allows you to quickly and easily display the print preview window or mode for the entire Excel workbook. Every worksheet within the workbook will be put into the print preview mode and readied for printing.

This is a great macro to assign to a button to enable users to more quickly and easily view their Excel files in the print preview mode.
Where to install the macro:  Module

Macro to Display The Print Preview Screen for The Entire Workbook in Excel

Sub Print_Preview_Entire_Workbook()
'Show the print preview window for the entire active Excel workbook or file

Worksheets.PrintPreview

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

Trying To Print Preview Entire Workbook - Excel

View Content
Hi,

I'm trying to view all the tabs of a workbook by selecting:

File | Print | Print What: Entire Workbook | Preview

but when i choose "Entire Workbook", the Preview button is dimmed and I
cannot select it.
I've used this method before, and it's worked, but now it doesn't.

When "Acive Sheet(s)" or "Selection" is selected the preview is
undimmed.

Why is this happening?



Why Do The Excel Cell Colors Only Display In Print Preview? - Excel

View Content



Screen View Not Same As Print Preview - Excel

View Content
Using Office 2007, but it worked in Office 2003. Win XP, Office 2007 Excel. I am updating my phone book, 1 column 75.0 wide, Text. Type in a name & address and space over to the right and enter the phone number. Space n number of times so as to align the numbers. Using Arial TT font, the screen alignment of the phone number does not match Print Preview alignment. Printing matches Print Preview. Using a second column for the number is not an option. Courier font is not an option. Use a table in MS Word is a solution because it works there, but does not fix the Excel problem.

Disabled Command Buttons On Print Preview Screen - Excel

View Content

Print Preview Options And Full Screen Mode - Excel

View Content
I'm developing an application in Excel 2007 and open the workbook in Full Screen mode.

I have 2 questions:

Can I stop the user exiting full screen mode? Obviously I will need to make this ability available to myself so that I can modify, but I wonder if there's a way I can password protect this?

I have a button on the main page for printing a report. This runs a macro which hides some sheets and prints the remaining sheets:

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

However, in full screen mode, the user doesn't see the close preview or print options so they can preview the report but have to exit full screen mode to actually print it! Not ideal. Does anyone know how I can get round this, particularly bearing in mind my first question?

Any thoughts would be appreciated. Thanks

Print Is Different Then Print Preview/screen - Excel

View Content
Help!!!!

Several members of my faculty are experiancing difficulty with a sheet in a workbook that they use not printing properly.

Specificly, the text contents in the cells of this particular column appear to fit each cell on screen, text is all single spaced on screen and is word wrapping properly.

When my faculty go to print this worksheet, the text in the aforementioned cells Appear to be double spaced and not all of the text appears. (The cells are physicly the same width as on screen/print preview... its almost like the cell contents expanded to double spaceing and are hidden behind the cells below it).

One of my faculty members emailed this worksheet to someone outside of our building and that person was able to sucessfuly print the worksheet without the doublespaceing issue.

It should be noted that other faculty memebers have not had any problems, only a small select few.

The printers we use in house are HP 4500, and HP 2100 (both are laser printers).

Any advice in this matter would be greatly appreciated.

- Zoebear

Unable To Adjust Bottom Margin In Print Preview Screen - Excel

View Content
Microsoft Excel 2003

When in the print preview pane i am unable to adjust the bottom margin. It
is invisible, however when you hover over top of where it is you're able to
drag it. The result is that it goes back to where it was at .55 and
invisible. Left, right and center are visible and work fine. Attempted
View-options and manually typed in .2 instead of .55 to no avail. It's the
FOOTER MARGIN that's the problem! Got a fix?
Please let me know
Thanks


How Do I Display The Print Preview Commandbar? - Excel

View Content
My workbook has several rows at the top which I want to use as a header for the first few pages, but not the last. So I've used some VBA code in the beforeprint event to cancel the print job, print the first few pages of the workbook, hide the unwanted rows and then print the last page.

It worked fine in Excel 2003 but in Excel 2007 the print preview command bar is not displayed so the user has no way of closing the print preview except closing the application from the taskbar.

Is there a way of displaying the print preview commandbar in Excel 2007?

Vba To Display And Close Print Preview - Excel

View Content
Hi There,

Am wanting to write some code that displays a sheet in print preview, waits for 10 seconds, then moves onto another sheet but seems that whenever print preview is on, the macro stops running until the preview is manually closed.

Any thoughts?

Cheers - Paul

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


Random Tutorials
Net Present Value / Discounted Cash Flow Calculations
(Intermediate)
Extract Text from Cells - Intermediate Example
(Intermediate)
Lookups With MATCH() and INDEX() Functions
(Intermediate)
IF Statement Introduction & Using Nested IF's
(Easy)
Function and Formulas Lookup in Excel
(Easy)
Assign a Macro to a Button and Toolbar
(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