Caption control on shapes

R

RobN

Is there any control, through VBA or other, over the text/caption for
shapes?

ie similarly to what the CommandButton1.Caption = "xxx" and
CommandButton1.BackColor = &HFF00& do.

Rob
 
K

Ken Johnson

Is there any control, through VBA or other, over the text/caption for
shapes?

ie similarly to what the CommandButton1.Caption = "xxx" and
CommandButton1.BackColor = &HFF00& do.

Rob

If the Shape is one that can show text (has a Textframe) then...

With ActiveSheet.Shapes("Oval 1")
.TextFrame.Characters.Text = "xxx"
.TextFrame.Characters(2, 1).Font.Bold = True 'makes 2nd x bold
(Start = 2, Length =1)
.Fill.ForeColor.RGB = RGB(255, 255, 0) 'adds a yellow fill
'.Fill.ForeColor.SchemeColor = 13 'another way of adding the
yellow fill
End With

Ken Johnson
 
R

RobN

Thanks Ken,

But I can't seem to find the name of the shape anywhere in properties, etc.
It certainly contains text, but I presume I need to call it the exact name
within the VBA code.

Any ideas?

Rob
 
A

Andy Pope

Hi,

When you select the shape it's name should appear in the Name Box, next to
the formula bar.

Cheers
Andy
 
R

RobN

Thanks Andy,

I did know that.....or so I thought! What was showing was "Snip Same Side
Corn...", so I thought it wasn't showing the name at all, but when I clicked
into the Name Box it revealed the full name, "Snip Same Side Corner
Rectangle 2".

Rob
 
Top