ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   activesheet.shapes("Group 1...n") (https://www.excelbanter.com/excel-programming/389593-activesheet-shapes-group-1-n.html)

Andreww

activesheet.shapes("Group 1...n")
 
Hi - I have some radio/option buttons inside a group box which is then
all grouped together and locked in place.

I want to be able to (use VBA) to change the option button text. When
I record a macro and then try and rerun it with different text, I get
a message "The item with the specified name doesn't exist"

Code is

ActiveSheet.Shapes("Group 4").Select
Selection.ShapeRange.Ungroup.Select
ActiveSheet.Shapes("Group Box 1").Select
ActiveSheet.Shapes("Option Button 2").Select
Selection.Characters.Text = "Cheese"

Then when I check the name of the "group... " it's incremented by 1!

Any ideas how I can change the button text??

Thanks

Andrew


Andreww

activesheet.shapes("Group 1...n")
 
Solved this much more easily...

ActiveSheet.Shapes("option button 34").Select
Selection.Characters.Text = "Per User"

Thanks brain!

Andrew




All times are GMT +1. The time now is 06:25 AM.

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