How to Use Excel VBA for Printing

Written by deborah kulish Google
  • Share
  • Tweet
  • Share
  • Pin
  • Email
How to Use Excel VBA for Printing
Excel's VBA Printout Method expedites printing a report. (Hemera Technologies/Photos.com/Getty Images)

A Visual Basic Application (VBA) procedure is used to automate routine tasks in Microsoft Excel in order to save time. The VBA Printout Method you enter sends the documents you indicate to your default printer from your computer. Three different Printout Methods allow you to print the workbook, the worksheet or a range in the worksheet. You can use one or all of them as necessary. They are easy to enter and will save you the time of manually sending your documents to the printer.

Skill level:
Moderate

Other People Are Reading

Instructions

  1. 1

    Open the Excel file containing the procedure that you want to add the Printout Method to. Decide which of the three Printout Methods is best to use in your procedure.

  2. 2

    Open the VBA Editor to view your procedure. A shortcut to do this is to press "Alt" and "F11." In your procedure locate the area where you want to enter the Printout Method. Usually this method is located at or near the end of the procedure.

  3. 3

    Enter the Workbooks' Printout Method command by typing the following:

    Workbooks("Book1").Printout

    This method prints all the worksheets in the Excel workbook. Replace "Book1" in quotations with the title of your workbook.

  4. 4

    Enter the Worksheets' Printout Method syntax as in the example. This method prints only one worksheet in the Excel workbook. However, you can enter it as many times as you have worksheets to print.

    Worksheets("Sheet1").Printout

    Replace Sheet 1 in quotations with the worksheet tab you want to print.

  5. 5

    Enter the Worksheets' Range Printout Method syntax as in the example. This method prints a range, a selection of cells in a worksheet. You can enter it as many times as you have ranges to print.

    Worksheets("Sheet1").Range("A1:A20").Printout

    Replace Sheet 1 in quotations with the worksheet tab, and replace A1:A20 with the range of cells you want to print.

Don't Miss

Filter:
  • All types
  • Articles
  • Slideshows
  • Videos
Sort:
  • Most relevant
  • Most popular
  • Most recent

No articles available

No slideshows available

No videos available

By using the eHow.co.uk site, you consent to the use of cookies. For more information, please see our Cookie policy.