Share via

How to reference text in a rectangle shape

Anonymous
2014-08-22T17:44:49+00:00

What is the VBA command to reference the text that is in an enclosed shape on a worksheet?  I have two rectangles that are used as "check boxes" -- they might have an "X" in them.  I need to be able to store that text, if it exists, in a cell on a different worksheet.  I'm guessing this is close: rect4 = ActiveSheet.Shapes.Range(Array("Rectangle 4")).Text  but apparently ".Text" needs to be something else.

Thanks in advance for any and all help!

Michelle K.

Microsoft 365 and Office | Excel | For home | Windows

Locked Question. This question was migrated from the Microsoft Support Community. You can vote on whether it's helpful, but you can't add comments or replies or follow the question.

0 comments No comments

Answer accepted by question author

Anonymous
2014-08-22T17:49:39+00:00

Hi,

Try this syntax

Dim t As String

t = ActiveSheet.Shapes("Rectangle 4").TextFrame.Characters.Text

Was this answer helpful?

0 comments No comments

1 additional answer

Sort by: Most helpful
  1. Anonymous
    2014-08-22T17:57:23+00:00

    That's exactly what I need!!!  Thank you very much -- and especially for that lightning fast response!

    Michelle K.

    Was this answer helpful?

    0 comments No comments