Change Shape Text

R

rhani111

Hi All,

I hope someone can help cause I'm pulling my hair out .......grrrr

I have a button that when clicked changes the text on the button to a
cell reference...no problems there.....BUT I cannot seem to get the
alternative text (if the cell reference is blank) to show up...

Here is what I have so far...

Dim shp As Shape
Set shp = ActiveSheet.Shapes("Button 415")
sText = Sheet27.Range("C1").Text
shp.TextFrame.Characters.Text = sText
If Sheet27.Range("C1").Text <> "" Then
On Error Resume Next
shp.TextFrame.Characters.Text = "My Button"

can someone help PLEASE??? wahhhhhhhh
 
M

Mallycat

I think this
If Sheet27.Range("C1").Text <> "" Then
On Error Resume Next
shp.TextFrame.Characters.Text = "My Button"


should be this
If Sheet27.Range("C1").Text = "" Then
shp.TextFrame.Characters.Text = "My Button"
end if

I haven't tested it though
 
R

rhani111

Thanks so much Mally.....

I had finally worked it out for myself....

Took forever for me to find the answer....but I got it..
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top