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

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

Improved? Move/Copy Add-in Replacement - How to avoid the annoying, “A formula or sheet you want to move or copy contains the name XXX, which already exists on the destination worksheet.” David Miller (dlmille)  It was one of those days… I wa…
This tutorial explains how to create a series of drop-down lists that are dependent upon prior selections to guide (“force”) the user to make the correct selection and reduce data errors within Microsoft Excel. Excel 2010 was used for this tutorial;…
This Micro Tutorial will demonstrate how to use longer labels with horizontal bar charts instead of the vertical column chart.
This Micro Tutorial demonstrates in Microsoft Excel how to consolidate your marketing data by creating an interactive charts using form controls. This creates cool drop-downs for viewers of your chart to choose from.

739 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