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?

 

Coding4Fun

Active Member
Joined
Feb 16, 2017
Messages
344
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:

jay2kidd

New Member
Joined
Jun 11, 2018
Messages
2
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.
 

Coding4Fun

Active Member
Joined
Feb 16, 2017
Messages
344
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.
Glad that worked and thank you for the tip.
 

Forum statistics

Threads
1,082,257
Messages
5,364,074
Members
400,778
Latest member
Canadian Sal

Some videos you may like

This Week's Hot Topics

  • populate from drop list with multiple tables
    Hi All, i have a drop list that displays data, what i want is when i select one of those from the list to populate text from different tables on...
  • Find list of words from sheet2 in sheet1 before a comma and extract text vba
    Hi Friends, Trying to find the solution on my task. But did not find suitable one to the need. Here is my query and sample file with details...
  • Dynamic Formula entry - VBA code sought
    Hello, really hope one of you experts can help with this - i've spent hours on this and getting no-where. .I have a set of data (more rows than...
  • Listbox Header
    Have a named range called "AccidentsHeader" Within my code I have: [CODE]Private Sub CommandButton1_Click() ListBox1.RowSource =...
  • Complex Heat Map using conditional formatting
    Good day excel world. I have a concern. Below link have a list of countries that carries each country unique data. [URL...
  • Conditional formatting
    Hi good morning, hope you can help me please, I have cells P4:P54 and if this cell is equal to 1 then i want row O to say "Fully Utilised" and to...
Top