XL: Grouped Drawing Objects Run Separate Macros

Last reviewed: February 3, 1998
Article ID: Q160004
The information in this article applies to:
  • Microsoft Excel 98 Macintosh Edition
  • Microsoft Excel 97 for Windows
  • Microsoft Excel for Windows 95, versions 7.0, 7.0a
  • Microsoft Excel for Windows, versions 5.0, 5.0c
  • Microsoft Excel for the Macintosh, versions 5.0, 5.0a

SYMPTOMS

When you group two or more drawing objects on a worksheet, assign separate macros to each of the different objects that make up the group, and then click an object in the group, the macro that is assigned to the object you clicked runs.

CAUSE

You cannot run one macro that is assigned to a group of objects when you click an object that belongs to a group (unless you assign the same macro to each object in the group).

WORKAROUND

If you want each object in a group to run the same macro, and each object is assigned to a separate macro, ungroup the set, reassign the same macro to each object, and then regroup the objects.

STATUS

This behavior is by design of Microsoft Excel.

MORE INFORMATION

Grouping Objects

  1. Select the circle.

    NOTE: If you assigned a macro to the circle, press and hold down CTRL, and then click the circle.

  2. Press and hold down SHIFT, and then click the rectangle.

    NOTE: If you assigned a macro to the rectangle, press CTRL+SHIFT as you

       click the rectangle. In Microsoft Excel for the Macintosh, press    
    
COMMAND+SHIFT as you click the rectangle.

   This step selects both objects on the worksheet.

  • If the Drawing toolbar is not visible, point to Toolbars on the View menu, and then click Drawing.

  • In Microsoft Excel 97 or Microsoft Excel 98, click Draw on the Drawing toolbar, and then click Group. In Microsoft Excel 5.0 and 7.0, click Group Objects on the Drawing toolbar.

    The two objects are grouped.

    NOTE: Steps 1 through 3 are the same in Microsoft Excel 97 and Microsoft Excel 5.0 and 7.0.

    Ungrouping Objects

    1. Select the group.

      NOTE: If you assigned macros to the objects in the group, press CTRL as you click any object in the group.

    2. If the Drawing toolbar is not visible, point to Toolbars on the View menu, and then click Drawing.

    3. In Microsoft Excel 97 or Microsoft Excel 98, click Draw on the Drawing toolbar, and then click Ungroup. In Microsoft Excel 5.0 and 7.0, click Ungroup Objects on the Drawing toolbar.

      The two objects are ungrouped.

    NOTE: Steps 1 and 2 are the same in Microsoft Excel 97 and Microsoft Excel 5.0 and 7.0.

    REFERENCES

    For more information about grouping objects, click the Index tab in Microsoft Excel 97 Help, type the following text

       grouping, drawing
    
    
    and then double-click the selected text to go to the "Group, ungroup, regroup drawing objects" topic.


  • Additional query words: 5.00 7.00 XL98 XL97 XL7 XL5
    Keywords : kbprg kbtool xlvbainfo xldraw PgmOthr
    Version : WINDOWS:5.0,7.0,97; MACINTOSH:5.0,98
    Platform : MACINTOSH WINDOWS
    Issue type : kbprb
    Solution Type : kbworkaround


    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: February 3, 1998
    © 1998 Microsoft Corporation. All rights reserved. Terms of Use.