How to call out object's text w/o selecting

  • Thread starter Thread starter Wandering Mage
  • Start date Start date
W

Wandering Mage

If Right(Sheets("DATABASE VIEW").Shapes
("stations").Characters.Text, 3) = "OFF" Then hasstation =
1


This is what I am trying to do, I want to check to see if
the text (the last 3 letters) in the button
called "stations" are "OFF". I do not want to select the
button to do this, however. I tried above script, but it
does not work. Let me know if you have a solution. As
always, for the millionth time!, all help is appreciated!
Thanks.
 
Wandering,

You need to use the shape's TextFrame object to access the Text:

If Right(Sheets("DATABASE
VIEW").Shapes("stations").TextFrame.Characters.Text, 3) = "OFF" Then....

HTH,
Bernie
MS Excel MVP
 
Awesome, thanks!
-----Original Message-----
Wandering,

You need to use the shape's TextFrame object to access the Text:

If Right(Sheets("DATABASE
VIEW").Shapes("stations").TextFrame.Characters.Text, 3) = "OFF" Then....

HTH,
Bernie
MS Excel MVP




.
 

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