ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   How to ungroup a set of controls? (https://www.excelbanter.com/excel-programming/318889-how-ungroup-set-controls.html)

Josh Sale

How to ungroup a set of controls?
 
I'm trying to figure out how to ungroup a set of controls that reside on a
worksheet.

Basically I'm starting with an object reference to one of the controls
(e.g., a textbox) in the group. I thought I could do something like:

myTextbox.ShapeRange.Ungroup

but that just causes a runtime error (1004).

I've also tried:

myTextbox.Select
Selection.ShapeRange.Ungroup

and that seems to work sometimes but the results are a bit unpredictable.

Also is there a way to figure out if a control (e.g., myTextbox) is part of
a "user defined" group? It seems like some of Excel's control's (e.g., a
ComboBox) are built up from other more basic controls and then grouped. I
don't want my code to ever ungroup a ComboBox into its constituent objects.

TIA,

josh




All times are GMT +1. The time now is 01:56 AM.

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