Sometimes we setup Excel worksheets so that they flow logically on the screen. Often times they’re set up like you would read a book, top to bottom, left to right, but this isn’t always the best setup for printing.
Suppose you have a spreadsheet with detailed information in the first 50 rows, and then a summary in the next 10. There could be times where you don’t care to print the details, and only want the summary, or the opposite. Of course, you could set up your spreadsheet so that the details are in one worksheet and the summary is in another, each with their print areas set up correctly. But that would make viewing the spreadsheet on the screen that much more difficult, as you would have to click between the two in order to analyze the data.
This is where custom views help. Read below for a step-by-step example on how to setup custom views.
This example assumes that you have your detailed information (print area # 1) in the first 50 rows in columns A through M, and your summary information (print area # 2) in the next 10 rows in the same columns. You can set more than just two print areas using custom views, but for simplicity’s sake, we’ll use two for now.
- First, select print area # 1 (cells A1:M50)
- Click File | Print Area | Set Print Area
- Click File | Page Setup and set your print settings for that area (i.e. header/footer, portrait/landscape, letter/legal/other paper size, fit page to 1 by 1 or 100%, etc.)
- Click View | Custom Views and then click the “Add” button. In the dialog box, enter a description of the view (in this case, “print_detail” without the quotes would work)
- Save your file.
Now that you have your first print area setup, we’ll repeat the previous steps to setup the second print area for the summary section.
- Select print area # 2 (cells A51:M60)
- Click File | Print Area | Set Print Area
- Click File | Page Setup and set your print settings for that area (i.e. header/footer, portrait/landscape, letter/legal/other paper size, fit page to 1 by 1 or 100%, etc.)
- Click View | Custom Views and then click the “Add” button. In the dialog box, enter a description of the view (in this case, “print_summary” without the quotes would work)
- Save your file.
OK, both print areas are setup. Now we need to be able to use them.
- Click View | Custom Views
- You should see the two custom views we just created in the box, print_details and print_summary
- Click on the one you wish to print and then click the “Show” button
- You can double check that the print area is set to your liking by clicking File | Print Preview. This will show how your printout will look after printing. If you don’t need to make any changes, simply click File | Print.
Added Bonus – Set a Macro to Print Your Custom View
So far we’ve covered how to set a custom view to make printing easier. We’ll lets go one step further and make it even easier.
Insert the following macro code in your Visual Basic Editor to have Excel select the custom view and print it out all in one click!
Note: The macro code will print one custom view (currently set to print the details from the example above). You’ll need to copy this macro for as many custom views as you have. For each custom view change print_custom_view() to a unique name and also change the line “print_details” to whatever you have named your custom view.