Enterprise Software

Office solution: Printing different views of the same Excel sheet efficiently

This week, learn the solution to last week's Office challenge: What's the most efficient way to print different areas of the same Excel sheet?
Last week, we asked for an efficient solution for printing different areas of the same sheet. Users tend to waste time resetting each print task. Zimmerwoman and I are on the same page with one solution: use custom views. Views save print settings, so you can select a view and print-without resetting anything when you're ready to print. The good news is, users can do this themselves. To set a custom view, arrange everything the way you want, including the print settings. Then, do the following:

  1. Click the View tab.
  2. In the Workbook Views group, click Custom Views.
  3. Click Add.
  4. Enter a name for the view (the print setting option is checked by default).
  5. Click OK.

A second solution is a set of macros using the following generic procedure:

Sub Printrange()
 ActiveSheet.PageSetup.PrintArea = Range("range").Address
 ActiveWindow.SelectedSheets.PrintOut
End Sub

First, you must create range - a named range that includes the data you want to print. Then, run the appropriate macro to print each range, as needed. For instance, you might have three print ranges named Outlook, Sales, and Trends. In this case, you'd have three sub procedures, PrintOutlook, PrintSales, and PrintTrends. A more efficient solution would be to pass a selected range via a user control:

Sub PrintPassedRange(prtrange As String)
 ActiveSheet.PageSetup.PrintArea = Range("prtrange").Address
 ActiveWindow.SelectedSheets.PrintOut
End Sub

You can also use the procedure to set additional print settings, such as orientation, copy number, and so on.

Once again, thanks to everyone who played along!

About

Susan Sales Harkins is an IT consultant, specializing in desktop solutions. Previously, she was editor in chief for The Cobb Group, the world's largest publisher of technical journals.

5 comments
Answers
Answers

Custom Views in Excel is the easiest and best way to view or print the same worksheet in different ways because you can apply sort and filter, have different headers and footers, different page orientation and hide columns and rows as part of a view. You can then switch easily from one view to another without having to do anything further or learn any shortcuts. I love using Custom Views because of its simplicity alone.

yourwork
yourwork

Select the area of spread sheet you wish to print, hold down the Ctrl key and select successive parts of the spreadsheet, let go of the Ctrl key and press the print icon and you will get each selected area of the spreadsheet printed on different sheets. It's easy, why bother with coding?

BALTHOR
BALTHOR

if you approach it with this in mind it would be good.Think about a disk writing program.Step by step the electronics has to be told what to do.Win Builder calls it script,a program order of events.You tell the computer what to do and it does it.I use this script file because it gets calls the disk writer and so on.It really has to be exact and unerring at this level.That's why I like computers.Somewhere in there is a citadel or reason and logic.

BALTHOR
BALTHOR

Vhd,ISO,restore files and many other types of files are image files.They are an image of the contents on the hard drive.What makes them different is unknown to me.Some software programs will say that little is known about this or that file type.Are the operating rules that we are seeing for the computer the designer's rules or some system that for some just is.I'm in deep and I am still wondering about the logic system used.With your disk writing software you can make an ISO file that can be used in VBox.If you use a computer restore file you can experiment as much as you want.With VBox you might use XP instead of Win 7.They yell at you for not being x64 even though you are.It's a lot of hard work and then you get stopped somewhere by a pop up.Making a vhd of XP was nice for me.I use it a lot.I put my vhd's on DVD's for future use.

BALTHOR
BALTHOR

I used disk2vhd to render a vhd of my desktop but it only got so far in VBox.I'm thinking that the operation loading bar graphs at the beginning are some sort of boot loader.It did those two then stopped and started over.Remember this is a digital file reader machine and it appears to have some rules.It could be it was whatever they could get to work made it to the OS.There are some programs that will allow you to dual boot a vhd.They're cool to see work.I did another one where you call up a command prompt at the Win 7 install,I assume after the adapter card driver is loaded.This one,some command prompt stuff from a site,was supposed to install the OS right into a vhd right on the hard drive.I ended up with a 78 mb vhd file that didn't run in VBox.I don't like command prompt at all but his rap sounded so convincing.I ended up putting my Active Boot Disk restore for my laptop in the SD drive and a Boot (x) file appeared.This one is nice.I also downloaded the BIOS flash for the laptop and run that one several times a day.With BIOS flashing you're on your own.It's a heart pounder.If it sticks at all fans running with no boot just slide the battery out and in again with the power disconnected.