+ Reply to Thread
Results 1 to 5 of 5

Finding a shapes name

  1. #1
    Registered User
    Join Date
    02-12-2007
    Posts
    88

    Finding a shapes name

    I have several rectangles on a sheet in my workbook. I am trying to write some code that will find the shapes name when clicked and enter this name into a cell, but am having no luck so far.

    i.e. one shape is named Test. I want Test to be entered into cell A1 when I click on that shape. Ive tried something like Selection.ShapeRange.Name but that doesn't seem to work.

    Any ideas??

  2. #2
    Forum Expert sweep's Avatar
    Join Date
    04-03-2007
    Location
    Great Sankey, Warrington, UK
    MS-Off Ver
    2003 / 2007 / 2010 / 2016 / 365
    Posts
    3,446
    Hi,

    How about assigning macros to the shapes, which identify the shape via a cell?

    eg

    Please Login or Register  to view this content.
    Rule 1: Never merge cells
    Rule 2: See rule 1

    "Tomorrow I'm going to be famous. All I need is a tennis racket and a hat".

  3. #3
    Registered User
    Join Date
    02-12-2007
    Posts
    88
    That was the idea - to have macros assigned to each one, however I only want one macro as I have a lot of shapes. That is why it needs to identify the shape that was just clicked

  4. #4
    Forum Expert mikerickson's Avatar
    Join Date
    03-30-2007
    Location
    Davis CA
    MS-Off Ver
    Excel 2011
    Posts
    6,229
    If each of your shapes is assigned to this sub, I think it will do what you want.
    Please Login or Register  to view this content.

  5. #5
    Registered User
    Join Date
    02-12-2007
    Posts
    88
    Yes that works great.

    Thank you for your help

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

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