Excel: Creating a SUM Formula with a Macro Using Input RangeLast reviewed: November 30, 1994Article ID: Q27717 |
SUMMARYThe following information describes how to build a macro step in Microsoft Excel to create a formula in a worksheet cell using a reference that you can input by selection. To build a macro statement that places a SUM formula in a cell using a cell or range you input, have the macro select the cell. Then include the following macro statement:
=FORMULA("=SUM("&RELREF(INPUT("select your cell(s): ",8), ACTIVE.CELL())&")")The command macro does the following: selects a cell, asks you to select the range of cells that the SUM function will reference, and enters the complete SUM function into the cell. Note: This information also applies to Microsoft Excel for Windows versions 2.1, 2.1c, and 3.0, and to Microsoft Excel for OS/2 versions 2.2, 2.21, and 3.0.
|
KBCategory: kbusage
© 1998 Microsoft Corporation. All rights reserved. Terms of Use. |