?
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
Medium Priority
?
110 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
[X]
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
  • 2
3 Comments
 
LVL 85

Accepted Solution

by:
Rory Archibald earned 2000 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: Subnet Calculator

The subnet calculator helps you design networks by taking an IP address and network mask and returning information such as network, broadcast address, and host range.

One of a set of tools we're offering as a way of saying 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

When you see single cell contains number and text, and you have to get any date out of it seems like cracking our heads.
This article describes how to use a set of graphical playing cards to create a Draw Poker game in Excel or VB6.
This Micro Tutorial will demonstrate in Microsoft Excel how to add style and sexy appeal to horizontal bar charts.
Excel styles will make formatting consistent and let you apply and change formatting faster. In this tutorial, you'll learn how to use Excel's built-in styles, how to modify styles, and how to create your own. You'll also learn how to use your custo…

719 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