Testing text on a shape

  • Thread starter Thread starter Ajtb
  • Start date Start date
A

Ajtb

Hi

Why does this line cause an error ?

If Sheets("Control").Shapes("Type1").Characters.Text = "OUTCOMES" Then C = 2


But this does not cause an error?

ActiveSheet.Shapes("Type1").Select
If Selection.Characters.Text = "OUTCOMES" Then ....


I would like to check the text on a shape which represents a button
without having to activate the sheet and select the shape first.

Any help appreciated on this one.

Andrew Bourke
Perth, Australia
 
? Sheets("Control").Shapes("Type1").TextFrame.Characters.Text = "OUTCOMES"
True

? Sheets("Control").Shapes("Type1").TextFrame.Characters.Text
OUTCOMES
 

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

Back
Top