Hover over different parts of image

jay2kidd

New Member
Joined
Jun 11, 2018
Messages
2
Hi Everyone,

I've signed up on the site as I cant figure out how to do this for the life of me. I'm trying to accomplish some sort of a heat map in excel where the values change depending on where the you hover in the map.

For example, using the image below. If i hover over number 1 it will populate data for that container on the right, and will change if i hover over 2,3,4 etc.

Also, am planning on populating the data for each container in another sheet.

Is this possible?

jhZiA8
jhZiA8
11.png
 

Excel Facts

Select all contiguous cells
Pressing Ctrl+* (asterisk) will select the "current region" - all contiguous cells in all directions.
This should point you in the right direction.

Create a new workbook - Add 2 Active X Labels (Important to make sure its the Active X Controls)

Go into the code for the worksheet that you have these 2 labels on and add this code. Once you do, now as you move your mouse over each label it will change the value in C12. Adjust to meet your need, you could also use on click vs mouse move. I would envision you making the labels invisible and laying them over your image in the proper place and then as you move the mouse over the various locations it will change the values on the table to the right.

Code:
Private Sub Label1_MouseMove(ByVal Button As Integer, ByVal Shift As Integer, ByVal X As Single, ByVal Y As Single)
    
    Range("C12").Value = "1250"
    
End Sub


Private Sub Label2_MouseMove(ByVal Button As Integer, ByVal Shift As Integer, ByVal X As Single, ByVal Y As Single)
    
    Range("C12").Value = "1500"
    
End Sub

I would love to know how you post pictures in this forum, I couldnt figure that out. :LOL:
 
Last edited:
Upvote 0
Thank you!

For the pictures you have to upload the image to a server such as Imgur , then click on the little picture image and paste the link to your uploaded image.
 
Upvote 0

Forum statistics

Threads
1,214,911
Messages
6,122,198
Members
449,072
Latest member
DW Draft

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