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
104 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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

Sparklines have been introduced with Excel 2010 and are a useful tool for creating small in-cell charts, used for example in dashboards. Excel 2010 offers three different types of Sparklines: Line, Column and Win/Loss. What it does not offer is a…
Introduction This Article is a follow-up to my Mappit! Addin Article (http://www.experts-exchange.com/A_2613.html), it was inspired by an email posting I made to EUSPRIG (http://www.eusprig.org/index.htm), I will briefly cover: 1) An overvie…
The viewer will learn how to create two correlated normally distributed random variables in Excel, use a normal distribution to simulate the return on different levels of investment in each of the two funds over a period of ten years, and, create a …
This Micro Tutorial will demonstrate in Microsoft Excel how to add style and sexy appeal to horizontal bar charts.

929 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

Need Help in Real-Time?

Connect with top rated Experts

13 Experts available now in Live!

Get 1:1 Help Now