Excel: Entering Multiple Text Lines in a Chart with a Macro

Last reviewed: November 29, 1994
Article ID: Q59968
The information in this article applies to:
  • Microsoft Excel for the Macintosh, versions 2.x, 3.0, 4.0

SUMMARY

In a text line in a Microsoft Excel chart, COMMAND+ENTER is used to separate lines of text. To create a macro that enters a multiline text label, concatenate (join) the text using the ASCII code for a return (ASCII 13).

For example, to enter the following as a piece of text in an Excel chart

   1989
   World Report
   Summary

type the following formula in the macro:

   =FORMULA("1989"&CHAR(13)&"World Report"&CHAR(13)&"Summary")

MORE INFORMATION

The CHAR(x) function inserts the character with the ASCII code of "x". The ampersand (&) operator concatenates individual pieces of text into one text string.

For more information on the CHAR function, see page 29 in the "Microsoft Excel Function Reference" version 3.0 manual. If you are using Excel 2.20, see page 27 in the "Microsoft Excel Functions and Macros" version 2.2 manual.

For more information on text concatenation, see page 107 in the "Microsoft Excel User's Guide" version 3.0 manual. If you are using Excel 2.20, see page 516 in the "Microsoft Excel Reference" version 2.2 manual.


KBCategory: kbother
KBSubcategory:

Additional reference words: noupd


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: November 29, 1994
© 1998 Microsoft Corporation. All rights reserved. Terms of Use.