+ Reply to Thread
Results 1 to 11 of 11

Get the TEXT of Clicked Shape

  1. #1
    Forum Contributor
    Join Date
    07-20-2012
    Location
    Kingdom of Saudi Arabia
    MS-Off Ver
    Excel 2016
    Posts
    103

    Get the TEXT of Clicked Shape

    Hi, i need a help

    I have Three Shapes their texts are A, B, and C

    These shapes all have the same name (UF_SinlgeList)

    i use the following code to get the text of clicked shape

    Please Login or Register  to view this content.
    when i click shape A the returned text is B, why???

    I attached by file

    Thanks for help
    Attached Files Attached Files
    Last edited by exceere; 07-03-2014 at 04:40 AM.

  2. #2
    Forum Guru Andy Pope's Avatar
    Join Date
    05-10-2004
    Location
    Essex, UK
    MS-Off Ver
    O365
    Posts
    20,429

    Re: Get the TEXT of Clicked Shape

    All the shapes have the same name. Code simply returns first item in collection matching.

    Give your shapes unique names.
    Cheers
    Andy
    www.andypope.info

  3. #3
    Forum Contributor
    Join Date
    07-20-2012
    Location
    Kingdom of Saudi Arabia
    MS-Off Ver
    Excel 2016
    Posts
    103

    Re: Get the TEXT of Clicked Shape

    Andy Pope, thank you for your quick replay,

    in my case i need the the three shapes to be have the same name

  4. #4
    Forum Guru Andy Pope's Avatar
    Join Date
    05-10-2004
    Location
    Essex, UK
    MS-Off Ver
    O365
    Posts
    20,429

    Re: Get the TEXT of Clicked Shape

    In that case then you will not be able to use the same event handler.

    Why must the names be the same?

  5. #5
    Forum Contributor
    Join Date
    07-20-2012
    Location
    Kingdom of Saudi Arabia
    MS-Off Ver
    Excel 2016
    Posts
    103

    Re: Get the TEXT of Clicked Shape

    Because is have a User Frame (SingleList) that has a comboox (SLst)

    i use the name of the shape to show SinlgeList USERFRAME for the three Shapes by using the following code:

    Please Login or Register  to view this content.
    and i use the TEXT of the shape to change of the items of the COMBOBOX by following code:

    Please Login or Register  to view this content.
    Thank you Andy pope
    Shape Name and Text.xlsm
    i reattached my file with full idea
    Last edited by exceere; 07-03-2014 at 09:51 AM.

  6. #6
    Forum Guru Norie's Avatar
    Join Date
    02-02-2005
    Location
    Stirling, Scotland
    MS-Off Ver
    Microsoft Office 365
    Posts
    19,643

    Re: Get the TEXT of Clicked Shape

    The shapes don't have to have the same name to call the same macro.
    If posting code please use code tags, see here.

  7. #7
    Forum Contributor
    Join Date
    07-20-2012
    Location
    Kingdom of Saudi Arabia
    MS-Off Ver
    Excel 2016
    Posts
    103

    Re: Get the TEXT of Clicked Shape

    Norie, Thanks

    Norie i used the name to show the UF by the following code

    Please Login or Register  to view this content.

  8. #8
    Forum Guru Norie's Avatar
    Join Date
    02-02-2005
    Location
    Stirling, Scotland
    MS-Off Ver
    Microsoft Office 365
    Posts
    19,643

    Re: Get the TEXT of Clicked Shape

    Why don't you just assign the same macro to each shape?
    Please Login or Register  to view this content.

  9. #9
    Forum Guru Andy Pope's Avatar
    Join Date
    05-10-2004
    Location
    Essex, UK
    MS-Off Ver
    O365
    Posts
    20,429

    Re: Get the TEXT of Clicked Shape

    Give the shapes unique names.
    Add sub to userform to load given items to list.
    Attached Files Attached Files

  10. #10
    Forum Contributor
    Join Date
    07-20-2012
    Location
    Kingdom of Saudi Arabia
    MS-Off Ver
    Excel 2016
    Posts
    103

    Thumbs up Re: Get the TEXT of Clicked Shape

    Andy Pope, thanks

    Your modefying is really excellent

    Thanks a million

  11. #11
    Forum Contributor
    Join Date
    07-20-2012
    Location
    Kingdom of Saudi Arabia
    MS-Off Ver
    Excel 2016
    Posts
    103

    Re: Get the TEXT of Clicked Shape

    Norie,

    Thank you very much for your trying to help me

+ 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. how to get the name of the shape clicked
    By Wizz in forum Excel Programming / VBA / Macros
    Replies: 6
    Last Post: 11-07-2013, 03:12 PM
  2. Which hyperlink was clicked and associated shape name
    By Rick_Stanich in forum Excel Programming / VBA / Macros
    Replies: 11
    Last Post: 02-22-2010, 05:30 PM
  3. Get name of clicked Shape
    By Zurn in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 07-24-2006, 10:05 AM
  4. Detect which shape was clicked....
    By Thief_ in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 07-15-2005, 12:05 AM
  5. [SOLVED] Detect which shape was clicked?
    By Thief_ in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 07-14-2005, 11:05 PM

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