Changing the Option Button Name (not Caption)

DRANDON

Active Member
Joined
Jun 30, 2006
Messages
268
I am trying to revise a few properties of an Option Button I have on my worksheet. I'm trying this:

Dim shp as shape
Set shp = ActiveSheet.Shapes(Selection.Name)

With shp.OLEFormat.Object
.Object.Caption = "2015"
.Name = "Y2015"
.Enabled = False
End With

All is successful except the Name. I've tried putting ".Object" in front of ".Name" to no avail. It remains what it was. Any ideas. Thank you so much.
 
After running the macro the Caption changes from "2013" to "2015". And the Enabled property is set to false so that the user cannot use it yet (greyed out). But the Name of the Option Button remains "Y2013".
 
Upvote 0

Excel Facts

How to total the visible cells?
From the first blank cell below a filtered data set, press Alt+=. Instead of SUM, you will get SUBTOTAL(9,)
Above the posted code there is also:
ActiveSheet.Shapes("Y2013").IncrementLeft 7.5
ActiveSheet.Shapes("Y2013").IncrementTop -75.5
 
Upvote 0

Forum statistics

Threads
1,215,327
Messages
6,124,290
Members
449,149
Latest member
mwdbActuary

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top