ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Option button group name (https://www.excelbanter.com/excel-programming/338426-option-button-group-name.html)

chad

Option button group name
 
How can I change the group name of an option button WITHIN A MACRO? I've
tried ActiveSheet.Shapes("OptionButton1").GroupName = "test" but I receive an
error message "Object doesn't support this property or method."

I can effectively change the name of the button by
"ActiveSheet.Shapes("OptionButton1").Name = "test" but I need to change the
group name. Thanks in advance!

-Chad

Tom Ogilvy

Option button group name
 
ActiveSheet.OleObjects("OptionButton1").Object.Gro upName = "Test"

--
Regards,
Tom Ogilvy


"Chad" wrote in message
...
How can I change the group name of an option button WITHIN A MACRO? I've
tried ActiveSheet.Shapes("OptionButton1").GroupName = "test" but I receive

an
error message "Object doesn't support this property or method."

I can effectively change the name of the button by
"ActiveSheet.Shapes("OptionButton1").Name = "test" but I need to change

the
group name. Thanks in advance!

-Chad




chad

Option button group name
 
Thanks Tom! Perfect!

"Tom Ogilvy" wrote:

ActiveSheet.OleObjects("OptionButton1").Object.Gro upName = "Test"

--
Regards,
Tom Ogilvy


"Chad" wrote in message
...
How can I change the group name of an option button WITHIN A MACRO? I've
tried ActiveSheet.Shapes("OptionButton1").GroupName = "test" but I receive

an
error message "Object doesn't support this property or method."

I can effectively change the name of the button by
"ActiveSheet.Shapes("OptionButton1").Name = "test" but I need to change

the
group name. Thanks in advance!

-Chad





Dave Peterson

Option button group name
 
How about just:

ActiveSheet.OptionButton1.GroupName = "test"
or
ActiveSheet.Shapes("optionbutton1").OLEFormat.Obje ct.Object.GroupName = "test"
or
ActiveSheet.OLEObjects("Optionbutton1").Object.Gro upName = "test"

I think I like the top one!

Chad wrote:

How can I change the group name of an option button WITHIN A MACRO? I've
tried ActiveSheet.Shapes("OptionButton1").GroupName = "test" but I receive an
error message "Object doesn't support this property or method."

I can effectively change the name of the button by
"ActiveSheet.Shapes("OptionButton1").Name = "test" but I need to change the
group name. Thanks in advance!

-Chad


--

Dave Peterson

chad

Option button group name
 
Thanks. These are all terrific!

"Dave Peterson" wrote:

How about just:

ActiveSheet.OptionButton1.GroupName = "test"
or
ActiveSheet.Shapes("optionbutton1").OLEFormat.Obje ct.Object.GroupName = "test"
or
ActiveSheet.OLEObjects("Optionbutton1").Object.Gro upName = "test"

I think I like the top one!

Chad wrote:

How can I change the group name of an option button WITHIN A MACRO? I've
tried ActiveSheet.Shapes("OptionButton1").GroupName = "test" but I receive an
error message "Object doesn't support this property or method."

I can effectively change the name of the button by
"ActiveSheet.Shapes("OptionButton1").Name = "test" but I need to change the
group name. Thanks in advance!

-Chad


--

Dave Peterson



All times are GMT +1. The time now is 11:55 AM.

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