+ Reply to Thread
Results 1 to 6 of 6

How to know which shape as triggered the userform

  1. #1
    Registered User
    Join Date
    04-04-2012
    Location
    Montreal, Canada
    MS-Off Ver
    Excel 2010
    Posts
    12

    How to know which shape as triggered the userform

    I need to determine which shape has been clicked to get the column of this shape.

    So I have multiple shapes in a worksheet and they all have the same name... (Automated generation) but they are in different culumns.

    Each shape has the same sub associated to his .Onaction which is a simple .show sub

    Please Login or Register  to view this content.
    Then at Userform_Initialize() I need to know which one has been clicked on.

    The problems is:
    - They all have the same name so this get the first named as the one clicked on in the shapeS collection
    Please Login or Register  to view this content.
    And the sheet must remains locked... So no selection...

    Any ideas?

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

    Re: How to know which shape as triggered the userform

    Why do all the shapes have the same name?

    That's going to make it pretty hard (impossible?) to tell which one was clicked.
    If posting code please use code tags, see here.

  3. #3
    Forum Expert shg's Avatar
    Join Date
    06-20-2007
    Location
    The Great State of Texas
    MS-Off Ver
    2003, 2010
    Posts
    40,678

    Re: How to know which shape as triggered the userform

    Why not give them unique names?

    Edit: Yeah, what Norie said. Or unique captions.
    Last edited by shg; 07-31-2013 at 11:19 AM.
    Entia non sunt multiplicanda sine necessitate

  4. #4
    Registered User
    Join Date
    04-04-2012
    Location
    Montreal, Canada
    MS-Off Ver
    Excel 2010
    Posts
    12

    Re: How to know which shape as triggered the userform

    The problem started has the shape is created with a generated column with datas ans then the datas are sorted horizontaly and the shapes doesnt follow the .insert shift to right...
    So the shapes have a common name the prevent any mistakes of shape name / data in the column..

    In addition to that, at generation, it must have a "Fill*" like name to it but the following number should follow the last one generated.. but its generated one a while so cant get a trace of last one created..
    Last edited by kebec_ska; 07-31-2013 at 11:20 AM.

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

    Re: How to know which shape as triggered the userform

    Why do they need to have the same name?

    Doesn't that just cause confusion, as it is for your userform question?

  6. #6
    Registered User
    Join Date
    04-04-2012
    Location
    Montreal, Canada
    MS-Off Ver
    Excel 2010
    Posts
    12

    Re: How to know which shape as triggered the userform

    Or i can simply add the follownig integer of my usedrange.columns.count the the "Fill*" name... after sorting they wont match but i'll get the topleftcell.column anyway...

+ 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. [SOLVED] Use a button to control a macro that inserts an image into a shape or resets the shape
    By nwb in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 05-13-2013, 04:41 PM
  2. How to show a chart with a shape on a userform using VBA
    By newbi004 in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 02-17-2013, 01:12 PM
  3. Replies: 0
    Last Post: 11-30-2012, 01:29 PM
  4. shape object on a userform?
    By Alan Ibbotson in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 04-25-2005, 09:06 AM
  5. Can I change the outer shape of a Userform?
    By Hurstwood47 in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 02-18-2005, 07:10 AM

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