Test for Shape is part of a group?

B

Brett

I can't seem to find the syntax for testing whether a shape is PART of a
group or whether it's the whole group itself (I want to BringToFront if it's
not part of a group, but I still want to bring the whole Group to the front).
I have (but want to get rid of the error trapping to make it more flexible):

Dim sh As Shape
On Error Resume Next
sh.Select
With Selection
.ZOrder msoBringToFront
While .ZOrderPosition > Cells(rw, cl + 6).Value
.ZOrder msoSendBackward
Wend
End With
On Error GoTo 0

Thanks, Brett
 
H

Homey

maybe-

if group shape.type = msogroup

or

if group then shape.GroupItems.Count > 0 (or not error)

|I can't seem to find the syntax for testing whether a shape is PART of a
| group or whether it's the whole group itself (I want to BringToFront if
it's
| not part of a group, but I still want to bring the whole Group to the
front).
| I have (but want to get rid of the error trapping to make it more
flexible):
|
| Dim sh As Shape
| On Error Resume Next
| sh.Select
| With Selection
| .ZOrder msoBringToFront
| While .ZOrderPosition > Cells(rw, cl + 6).Value
| .ZOrder msoSendBackward
| Wend
| End With
| On Error GoTo 0
|
| Thanks, Brett
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top