Editing a Worksheet Formula from a Macro in ExcelLast reviewed: November 4, 1994 |
2.x 3.00 4.00 4.00a 5.00 | 2.20 2.21 3.00 WINDOWS | OS/2 kbusage The information in this article applies to:
SUMMARYWhen you edit a formula contained in a worksheet from a macro, using the SEND.KEYS function replicates the manual editing steps, as the following example illustrates: =ACTIVATE("sheet1.xls") =SELECT("r12c2") =SEND.KEYS("{F2}editingtext~") In the SEND.KEYS line, {F2} takes you into edit mode on the formula bar. "editingtext" is the string of keystrokes to press if you are manually editing the formula. The tilde (~ or {ENTER}) terminates the edit mode and enters the formula into the selected cell. Note: The SEND.KEYS text is not sent until a dialog box is displayed, or the macro is finished, so the above cannot be repeated in a macro. MORE INFORMATIONExamples of SEND.KEYS function editing are as follows:
In the second example, {LEFT} moves the insertion point to the left one character, and {BS} backspaces one character each time, deleting "A10". REFERENCESFor more information on using the SEND.KEYS function, query on: send.keys and on.time |
KBCategory: kbusage |
Last reviewed: November 4, 1994
© 1998 Microsoft Corporation. All rights reserved. Terms of Use.