Excel: Using LINE.PRINT to Print Multiple Lines on a Page

Last reviewed: September 12, 1996
Article ID: Q101260
The information in this article applies to:
  • Microsoft Excel for Windows, versions 4.0, 4.0a, 5.0

SUMMARY

Normally the LINE.PRINT() function performs a form feed operation after it has printed. As a result, only one LINE.PRINT() job prints on a page. This article explains how to use the LINE.PRINT() function to print one or more lines of text to a single page.

MORE INFORMATION

The LINE.PRINT() macro function prints the active document using methods compatible with those of Lotus 1-2-3.

NOTE: LINE.PRINT() does not use the Microsoft Windows printer drivers.

Example

The following macro example sends a line of text to a printed log whenever the current time is past 10:00 A.M. (it does not perform a form feed operation after the print job, and therefore prints each line on the same page):

   A1:     Print_Macro
   A2:     =IF(NOW()>=TIME(10,0,0))
   A3:        =LINE.PRINT(5,,,,0,0,2,FALSE)
   A4:        =LINE.PRINT(1)
   A5:     =END.IF()
   A6:     =RETURN()

The arguments for this function are:
  • LINE.PRINT(LINE.PRINT(command,setup_text,leftmarg,rightmarg, topmarg,botmarg,pglen,formatted)
  • The command argument 5, in cell A3, tells Microsoft Excel to set up the page formats. The remaining arguments format the page without top or bottom margins, a page length of two lines (allowing for a blank line between each printed line), and no headers or footers.
  • The command argument 1, in cell A4, tells Microsoft Excel to print the currently defined print area on the active worksheet.

NOTE: The above settings are saved in the [Line Print] section of your EXCEL4.INI or EXCEL5.INI file. The "Function Reference," version 4.0, incorrectly states that this information is saved to the EXCEL.INI file.

REFERENCES

"Online Help," version 5.0 "Function Reference," version 4.0, pages 253-254


KBCategory: kbdocerr
KBSubcategory:

Additional reference words: 4.0 4.00 4.0a 4.00a 5.0 5.00 howto



THE INFORMATION PROVIDED IN THE MICROSOFT KNOWLEDGE BASE IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND. MICROSOFT DISCLAIMS ALL WARRANTIES, EITHER EXPRESS OR IMPLIED, INCLUDING THE WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. IN NO EVENT SHALL MICROSOFT CORPORATION OR ITS SUPPLIERS BE LIABLE FOR ANY DAMAGES WHATSOEVER INCLUDING DIRECT, INDIRECT, INCIDENTAL, CONSEQUENTIAL, LOSS OF BUSINESS PROFITS OR SPECIAL DAMAGES, EVEN IF MICROSOFT CORPORATION OR ITS SUPPLIERS HAVE BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. SOME STATES DO NOT ALLOW THE EXCLUSION OR LIMITATION OF LIABILITY FOR CONSEQUENTIAL OR INCIDENTAL DAMAGES SO THE FOREGOING LIMITATION MAY NOT APPLY.

Last reviewed: September 12, 1996
© 1998 Microsoft Corporation. All rights reserved. Terms of Use.