ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   group name for form controls (https://www.excelbanter.com/excel-programming/283846-group-name-form-controls.html)

Edwin Merced

group name for form controls
 
How can I access the group name property for the option button control
provided on the forms toolbar? As well as the other porperties of the form
control toolbox?



patrick molloy

group name for form controls
 
Unlike VB, in Excel VBA the option group box isn't - its
a frame, and doesn't have any properties that are set
when option buttons get set.
shame.
One workaoround is to use each option's click event to
save a number into the frame's TAG property - its not
used by anything else usually.
Then in your process, just read th etag value to get the
option.

Patrick Molloy
Microsft Excel MVP

-----Original Message-----
How can I access the group name property for the option

button control
provided on the forms toolbar? As well as the other

porperties of the form
control toolbox?


.


Dave Peterson[_3_]

group name for form controls
 
This worked ok if the optionbutton (from the forms toolbar) was in a groupbox:

Option Explicit
Sub testme()
Dim optBTN As OptionButton
Set optBTN = ActiveSheet.OptionButtons("Option Button 1")
MsgBox optBTN.GroupBox.Name
End Sub

And you can find lots of properties for these old style things in the Object
browser (F2 in the VBE.)

Right click in the object brower and select show hidden members.

Edwin Merced wrote:

How can I access the group name property for the option button control
provided on the forms toolbar? As well as the other porperties of the form
control toolbox?


--

Dave Peterson



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

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