Super User is a question and answer site for computer enthusiasts and power users. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I'm trying to access the text inside "Text Box 1", copy it and then paste it into a range beginning at A37.

UPDATE: the text boxes in question are simple text boxes that have been inserted using: Insert Tab > Text box button.

Below is a shambles of things I'm experimenting with. I can't seem to find the way to get at the text and copy it. Any ideas?

Sub textbox()

    Dim txBox As Shape
    Set txBox = ActiveSheet.Shapes("Text Box 1")
    'shpTextBox.selStart = 0
    'shpTextBox.SelLength = Len(shpTextBox.Text)

    Range("A37").Value = shpTextBox.Value    

End Sub
share|improve this question
up vote 1 down vote accepted

This works when I try it:

Dim txBox As Shape
Set txBox = ActiveSheet.Shapes("Text Box 1")

Range("A37").Value = txBox.TextFrame.Characters.Text
share|improve this answer
These text boxes already exist in the sheets I'm updating. They are simple text boxes inserted using the Insert Tab > Text box button. I think this may be why I'm running into the problems. – RocketGoal Jul 4 '13 at 14:42
@RocketGoal: see updated answer – James Jul 4 '13 at 15:31
It does what I couldn't make it do. Many thanks. – RocketGoal Jul 5 '13 at 9:45

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .