+ Reply to Thread
Results 1 to 3 of 3

Adding Text to a Shape with VBA

  1. #1
    Registered User
    Join Date
    10-12-2003
    Posts
    34

    Adding Text to a Shape with VBA

    I have a Shape (rounded rectangle) that I want to add text, then edit the text via VBA. When I record a macro doing this, the closest I can come is code that copies new text from a cell and then selects a cell (probably where the upper left corner of the shape is located), followed by ActiveSheet.Paste. But this is too inaccurate. I want to name the shape and then control the text.
    Paul

  2. #2
    Registered User
    Join Date
    10-12-2003
    Posts
    34

    Re: Adding Text to a Shape with VBA

    I solved it myself. Here's the code:

    Please Login or Register  to view this content.
    HTH
    Thanks
    Last edited by davesexcel; 10-23-2021 at 09:36 AM.

  3. #3
    Forum Expert skywriter's Avatar
    Join Date
    06-09-2014
    Location
    USA
    MS-Off Ver
    2016
    Posts
    2,760

    Re: Adding Text to a Shape with VBA

    You don't have to select it.
    The code is in the sheet module.
    Attached Files Attached Files
    Click the * Add Reputation button in the lower left hand corner of this post to say thanks.

    Don't forget to mark this thread SOLVED by going to the "Thread Tools" drop down list above your first post and choosing solved.

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. Adding Picture to Shape
    By ando185 in forum Excel General
    Replies: 0
    Last Post: 06-25-2013, 03:27 PM
  2. Adding a colored shape (rectangle) to a footer
    By tommyfernandez in forum Excel General
    Replies: 2
    Last Post: 12-19-2012, 02:34 PM
  3. Adding text to a freeform shape programmatically Excel VBA
    By waqas716 in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 10-01-2011, 07:57 AM
  4. Shape size based on text in shape
    By mwc48910 in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 03-23-2011, 05:43 AM
  5. Adding new shape to shape library
    By skrao81 in forum Excel General
    Replies: 3
    Last Post: 12-17-2010, 06:18 AM
  6. How to change shape text without selecting shape
    By wotadude in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 03-04-2009, 06:27 PM
  7. Retrieve Shape text when more than 255 characters inside shape
    By Wizz in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 03-04-2009, 10:09 AM
  8. [SOLVED] Adding a hyperlink to a shape
    By Rand in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 06-09-2006, 08:10 PM

Tags for this Thread

Bookmarks

Posting Permissions

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

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1