There are a few simple ways you can see exactly what you want to print on the Excel.
Let's see the 3 main ways to print a spreadsheet in Excel:
CTRL + P keyboard shortcut
It's as simple as it sounds, just type CTRL + P which will automatically pop up the print page with all the details, settings and button to print
Although not as fast as the keyboard shortcut, the file menu is also a very simple path. Just choose the File tab in the upper left corner of your worksheet (on the Home tab side).
After that, a new page will open automatically where you can choose the Print option, as shown in the image below:
Quick Access Toolbar
A third option is to use the Quick Access toolbar. First you need to enable the print button, which is the fourth icon in the image below (sheet with a magnifying glass). To do this, simply click on the little icon down the right corner of the toolbar and select the print option.
Preview Printing with VBA
Now, if you are using or developing a spreadsheet that will be shared by more people, you may find people who are not very accustomed to Excel and have difficulty finding print functionality. In such cases it is possible to bind a VBA code that has this functionality to a button. Let's see a very simple step-by-step how to do this:
- Open the VBE
Just go to the Developer tab and choose the Visual Basic option:
That way a new window (Visual Basic Editor) will open.
- Create a new module in VBE
Normally you already have 3 modules ready and empty to use, but if you have not, just right click on the Project - VBA Project window and add one.
- Type a new macro in the module
With the module open, go into the code window (larger blank) and start writing your first macro. To do this just type sub, give a space and enter the name that your macro will have. In our case I chose the name "print", press ENTER and you're done. It will be more or less what you will see in the code window:
- Add this VBA code to print preview
Now let's write the code for this print preview feature. I will not go into the details of the code, just copy and paste this line of code:
Application.Dialogs (xlDialogPrintPreview) .Show
See I wrote a comment (in green) in the code. In practice it has no functionality, just to inform another reader of what I intended to write the code.
- Create a button
Now let's get into the details of how to use this VBA code in practice. For this we will add a form in our spreadsheet. See I made a sales data table of branches and created a rectangular button (insert tab> form)
- Grip macro to button
With the button created, just select it with the right button and choose the "assign macro" option. Choose the option of the macro print.
- Ready! You can already use
Now, if you click the button, a new print preview window will automatically open, just like the one shown in the image below:
Obviously I've done the print set up to be neat. If you need, remember to 5 steps to print spreadsheets in Excel in this post.