Excel: Determining an Object's ID Number in a MacroLast reviewed: November 2, 1994Article ID: Q67481 |
SUMMARYWhen a Microsoft Excel macro creates an object with the function CREATE.OBJECT, the function will return a text string containing the object's ID (for example, "Oval 3"). This ID can be used to select the object in later macro commands or can be used with functions such as GET.OBJECT. If the object was created by copying and pasting an existing object, no value is returned to the macro. To determine the new object's ID, place a SELECTION statement directly after the PASTE function.
MORE INFORMATIONThe following macro determines the value of an object that was copied and pasted from an existing object:
=SELECT("Oval 3") =COPY() =PASTE() =SELECTION() =RETURN()The macro selects the existing object (Oval 3), copies it, and pastes it, and the SELECTION statement obtains the ID of the object currently selected (after an object is pasted, it is automatically selected). For more information on the SELECTION statement, see page 214 of the "Microsoft Excel Function Reference" version 3.0 manual.
|
KBCategory: kbother
© 1998 Microsoft Corporation. All rights reserved. Terms of Use. |