Results 1 to 4 of 4
  1. #1
    Silver Lounger
    Join Date
    Dec 2000
    Location
    California, USA
    Posts
    1,758
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Shapes Text (03)

    How does change the text in a rectangle shape?

    Example Code: This works fine but how do you do it without selecting the shape?
    ActiveSheet.Shapes(Rectangle 1).Select
    Selection.Characters.Text = "MyName"


    Thanks,
    John

  2. #2
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

    Re: Shapes Text (03)

    By using the TextFrame property of the shape:

    ActiveSheet.Shapes("Rectangle 1").TextFrame.Characters.Text = "Hans"

  3. #3
    Silver Lounger
    Join Date
    Dec 2000
    Location
    California, USA
    Posts
    1,758
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Shapes Text (03)

    Hans,

    One more thing...

    Why would the second line of code not work?
    Sheets("Sheet1").Shapes("Rectangle 1").Locked = False
    Sheets("Sheet1").Shapes("Rectangle 1").LockedText = False

    Thanks,
    John

  4. #4
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

    Re: Shapes Text (03)

    LockedText is not a property of a Shape, but of its ControlFormat property (I know, it's very confusing...). So it should be

    Sheets("Sheet1").Shapes("Rectangle 1").ControlFormat.LockedText = False

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •