ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Test for Shape is part of a group? (https://www.excelbanter.com/excel-programming/428713-test-shape-part-group.html)

Brett

Test for Shape is part of a group?
 
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

Homey

Test for Shape is part of a group?
 
maybe-

if group shape.type = msogroup

or

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

"Brett" wrote in message
...
|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



All times are GMT +1. The time now is 01:43 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com