how to update a cell by clicking on an image

peterdominic

New Member
Joined
Nov 28, 2017
Messages
3
I'm creating a dashboard that shows trucking lanes (picture a line image) on top of a map. My vision is to have the lines change colors based on a reference table <-- this part seems straight forward. But I'm struggling with the 2nd part of the vision -- I'd like the dashboard user to be able to click on any given line image (there will be dozens of lines) and have Excel populate the name of that image into a reference cell that would vlookup tables so charts would update. For instance, by clicking on the line between Dallas and Denver, I'd get my charts to show info related to that trucking lane.

Can anyone help me with how to click on an image and have a cell pull the name into it?
 

Excel Facts

Pivot Table Drill Down
Double-click any number in a pivot table to create a new report showing all detail rows that make up that number
You can assign this macro to all your lines:

Code:
Sub LineClick()
    Range("A1").Value = Application.Caller
End Sub

Just change the range to where you need to update your reference for the vlookup function. As long as all your lines are named the same as your lookup column in the table.
 
Upvote 0
Thank you!

you can assign this macro to all your lines:

Code:
sub lineclick()
    range("a1").value = application.caller
end sub

just change the range to where you need to update your reference for the vlookup function. As long as all your lines are named the same as your lookup column in the table.
 
Upvote 0

Forum statistics

Threads
1,216,075
Messages
6,128,665
Members
449,462
Latest member
Chislobog

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top