GroupObject Object

Description

Represents a group of graphic objects and controls. A group is created using either the Group method or the Group Objects button on the Drawing toolbar.

Do not confuse GroupObject objects, which combine objects into a single logical collection but do not affect dialog sheet behavior, with GroupBox objects, which group option buttons on a dialog sheet.

Accessors

The GroupObject object is a member of the GroupObjects collection. The GroupObjects collection contains all the GroupObject objects on a single sheet. Use the Group method to create a new group and add it to the collection. The following example creates a group containing all of the rectangles on worksheet one and then sets the position of the group.


Dim g As GroupObject
Set g = Worksheets(1).Rectangles.Group
g.Left = Worksheets(1).Range("c1").Left
g.Top = Worksheets(1).Range("c1").Top

To access a single member of the collection, use the GroupObjects method with the index number or name of the group as an argument.

The following example sets the interior color for all objects in group one on worksheet one.


Worksheets(1).GroupObjects(1).Interior.Color = RGB(0, 255, 0)

The group name is shown in the Name Box when the group is selected. Use the Name property to set or return the group name. The following example sets the border style for all objects in the group named "Group 24."


Worksheets(1).GroupObjects("group 24").Border.LineStyle = xlDashDot

Properties

AddIndent Property, Application Property, ArrowHeadLength Property, ArrowHeadStyle Property, ArrowHeadWidth Property, AutoSize Property, Border Property, BottomRightCell Property, Creator Property, Enabled Property, Font Property, Height Property, HorizontalAlignment Property, Index Property, Interior Property, Left Property, Locked Property, Name Property, OnAction Property, Orientation Property, Parent Property, Placement Property, PrintObject Property, RoundedCorners Property, Shadow Property, Top Property, TopLeftCell Property, VerticalAlignment Property, Visible Property, Width Property, ZOrder Property.

Methods

BringToFront Method, CheckSpelling Method, Copy Method, CopyPicture Method, Cut Method, Delete Method, Duplicate Method, Select Method, SendToBack Method, Ungroup Method.