Excel: SET.VALUE, SET.NAME, and DEFINE.NAME DifferencesLast reviewed: November 2, 1994Article ID: Q26066 |
SUMMARYThe following is a description of the differences among the Microsoft Excel macro functions SET.NAME, SET.VALUE, and DEFINE.NAME.
MORE INFORMATIONSET.VALUE is a macro control function that places specific value(s) directly into cell(s) on the macro sheet, whether the macro sheet is active or not. For example, the formula =SET.VALUE(C2,34.7) on a macro sheet titled "Macro1" will enter 34.7 into cell C2 on the "Macro1" macro sheet. SET.NAME is a macro control function that defines a variable name to be associated with a certain value on the macro sheet. The variable name can then be used in other macro statements to represent this value. For example, the following set of macro steps sets the value 2 to be associated with the name "test":
=SET.NAME("test",2) =FORMULA(test)This value is then placed into the active cell on the active worksheet. The macro sheet does not have to be active to use SET.NAME. DEFINE.NAME is a command-equivalent macro function that attaches a name to a cell category, value, or formula on the active worksheet or macro sheet. This name can then be used in place of the cell category or other value. For example, the following macro steps associate the name "answer" with cell $B$2 on the active worksheet and then place a formula, which divides this value by 100, into the active cell:
=DEFINE.NAME("answer",!$B$2) =FORMULA("=answer/100")The difference between SET.NAME and DEFINE.NAME is that SET.NAME can only define names on a macro sheet, and DEFINE.NAME always defines a name on the active window, whether the active window is a worksheet or macro sheet. For more information regarding SET.NAME, DEFINE.NAME, and SET.VALUE, see pages 48-49, 217-218, and 220-221 in the "Microsoft Excel Function Reference" version 3.0 manual. If you are using Excel 2.20, see pages 209-210, 279-280, and 281 in the "Microsoft Excel Functions and Macros" version 2.2 manual.
|
KBCategory: kbother
© 1998 Microsoft Corporation. All rights reserved. Terms of Use. |