Rounded Rectangle 1 - Shapes caption! Pls help!

pedie

Well-known Member
Joined
Apr 28, 2010
Messages
3,875
Code:
CommandButton1.Caption = "Stop"
But i am using "Rounded Rectangle 1" and I suppose "Rounded Rectangle 1" SHAPES does not have caption thing....

How can i make "Rounded Rectangle 1.Caption = "Stop" " work:)

it is giving me error

Thanks Ped
 

Excel Facts

Create a Pivot Table on a Map
If your data has zip codes, postal codes, or city names, select the data and use Insert, 3D Map. (Found to right of chart icons).
To change the text in a shape, the .TextFrame property has to be accessed

Code:
With ActiveSheet.Shapes("AutoShape 1")
    .TextFrame.Characters.Text = "Testing"
End With
The Object Browser shows all the properties and methods of a TextFrame (and Characters) that can give you total control over how the text is displayed.
 
Upvote 0
No VoG, this is from insert tab > Shapes > Rounded Rectangle 1


Lemmi giv it a try with mike's solution...

Thanks
 
Upvote 0
Mike, i tried the code and it is giving me error message:

Runtime error "-2147024809 - (80070057)"
the item with the specified name was nt found...

Do i have to change anything in the code??? or is this code applicable for all the shapes
 
Upvote 0
It worked sorry Mike;) and Thanks alot!!!

So suppose if I want to use the caption and if function together in vba how it this going to work.....

Code:
for example:
 
If CommandButton1.Caption = "Stop" Then
my code
 
Last edited:
Upvote 0
Code:
With ActiveSheet.Shapes("AutoShape 1")
    If .TextFrame.Characters.Text = "Stop" Then
        Rem do something
    Else
        Rem do something else
    End If
End With
 
Upvote 0
Mike, thanks alot!!!

Thank you so much for ur assistance today!

I exactly found the "what I am looking for";)

pedie
 
Upvote 0

Forum statistics

Threads
1,224,811
Messages
6,181,081
Members
453,021
Latest member
Justyna P

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