Excel: INPUT() Function Storing a Reference

Last reviewed: November 29, 1994
Article ID: Q24630

SUMMARY

When selecting a group of cells within an Input dialog box whose type is 8, the reference of the selection is displayed in the dialog box. However, when using the input results in another command in the macro, the reference is not seen as text and does not calculate properly.

To use the reference later, it must be saved as a text string. To save it as a text string when you run the macro, perform the following steps:

  1. When the Input dialog box appears, select the desired cells.

  2. Press BACKSPACE or DELETE.

  3. Click OK.

An alternative method is to embed the INPUT() function in a SET.NAME() function. For example, the following command will define a name of "ref" to the results of the Input dialog box:

   =SET.NAME("ref",INPUT("Select a cell",8))

"ref" could then be used in later macro commands in place of a reference to the INPUT() function.


KBCategory: kbusage
KBSubcategory:

Additional words: 1.0 1.00 1.03 1.04 1.06 1.5 1.50 2.0 2.00
2.01 2.1 2.10 2.2 2.20 2.21 3.0 3.00 4.0 4.00


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.