Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people, just like you, are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
Solved

How to click a picture within an xl cell and get the row and column values of that cell

Posted on 2014-11-11
3
106 Views
Last Modified: 2014-11-11
My xl WS has the same icon located in different cells of the same WS column. When one of those icons is clicked, I need to (1) obtain the row value within which the clicked icon was located AND (2) call a macro.

MY current FALL BACK SOLUTION is to make the xl cell within which the icon resides sufficiently WIDE for the user to double click part of the cell that is not occupied by Icon. This returns row and column values (via WS Double Click Event), but the user maneuver yields a poor user-experience!

I add icons to xl cells via automation:
    With Range(Cells(rn.row + 1, 7), Cells(rn.row + 1, 1))
        ActiveSheet.Shapes.AddPicture "D:\aaThink_Build\Thk_Building\xlImages\Fish.jpg", msoCTrue, msoTrue, .left, .top, -1, -1
        ActiveSheet.Shapes(ActiveSheet.Shapes.Count).height = .height
    End With

But even if I could (??) add the row/col values as icon FILE PROPERTIES (during automation) , I still dont know how to extract that information from the icon that is clicked. The icon files are .JPGs, but that can be changed.

Thanks,
Kelvin
0
Comment
Question by:Kelvin4
  • 2
3 Comments
 
LVL 85

Accepted Solution

by:
Rory Archibald earned 500 total points
ID: 40435387
Assign a macro to the inserted picture:

Sub PicClick()
msgbox Activesheet.SHapes(Application.Caller).Topleftcell.address
End Sub

Open in new window


:)
0
 

Author Closing Comment

by:Kelvin4
ID: 40435397
Oh yes, certainly :)!
Thanks for following up my first question!

Kelvin
0
 
LVL 85

Expert Comment

by:Rory Archibald
ID: 40435448
Glad to help. :)
0

Featured Post

Free Tool: ZipGrep

ZipGrep is a utility that can list and search zip (.war, .ear, .jar, etc) archives for text patterns, without the need to extract the archive's contents.

One of a set of tools we're offering as a way to say thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

INDEX and MATCH can be used to great effect to replace HLOOKUP and VLOOKUP as it does not have the limitation of needing the data to be sorted so that the reference value is in the first column or row. It also has the ability to perform a bi-directi…
Approximate matching with VLOOKUP and MATCH seems to me to be a greatly under-used technique, and one which is vital for getting good performance out of large lookups. Until recently I would always have advised using an exact match for simplicity an…
This Micro Tutorial demonstrate the bugs in Microsoft Excel for Mac with Pivot Charts.
Although Jacob Bernoulli (1654-1705) has been credited as the creator of "Binomial Distribution Table", Gottfried Leibniz (1646-1716) did his dissertation on the subject in 1666; Leibniz you may recall is the co-inventor of "Calculus" and beat Isaac…

856 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question