Microsoft KB Archive/160004

= Grouped Drawing Objects Run Separate Macros =

Article ID: 160004

Article Last Modified on 8/17/2005

-

APPLIES TO


 * Microsoft Excel 97 Standard Edition
 * Microsoft Excel 95 Standard Edition
 * Microsoft Excel 5.0 Standard Edition
 * Microsoft Excel 98 for Macintosh

-



This article was previously published under Q160004





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, Microsoft Excel runs the macro that is assigned to the object you clicked.



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.



Grouping Objects

 * 1) Select the circle.

NOTE: If you assigned a macro to the circle, hold down CTRL, and then click the circle.
 * 1) 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.
 * 1) If the Drawing toolbar is not visible, point to Toolbars on the View menu, and then click Drawing.
 * 2) 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.
 * 1) If the Drawing toolbar is not visible, point to Toolbars on the View menu, and then click Drawing.
 * 2) 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.

