+ Reply to Thread
Results 1 to 3 of 3

VBA/Macros mouse over to change an image

  1. #1
    Registered User
    Join Date
    Kansas City
    MS-Off Ver
    MS Office 360

    VBA/Macros mouse over to change an image

    I'm very new to using VBA in general and I cannot seem to find a way to create a mouse over command to make make an image change. I am familiar with the basic trick of using a comment and formating it. That is not what I want to do here.
    I want to hover the mouse over various cells or command buttons that display different regions around the world. I want the image to change so it looks like that region is highlighted when the mouse is over it.

    I've supplied images for North America as an example. You'll see when the mouse is over the North American cell the image changes. Extra points for getting the cell to glow when the mouse is over it.
    Of course, these are just screenshots I made to show what I'm trying to achieve here. Any assistance would be very appreciated.

    Excel document:

    Screenshots of what I want to do:



    Supported PNG images to use for the document:



  2. #2
    Forum Expert CK76's Avatar
    Join Date
    ONT, Canada
    MS-Off Ver
    Office 365 ProPlus

    Re: VBA/Macros mouse over to change an image

    There is no native event for triggering code when you hover over a cell.
    However, there is known hack, that makes use of UDF and Hyperlink function.
    While the article is old (and sample in 2nd link requires changing API call, if using 64 bit install of Office), I can confirm technique still works for Office 365.

    Have a read of following links.
    “Progress isn't made by early risers. It's made by lazy men trying to find easier ways to do something.”
    ― Robert A. Heinlein

  3. #3
    Forum Guru Andy Pope's Avatar
    Join Date
    Essex, UK
    MS-Off Ver

    Re: VBA/Macros mouse over to change an image

    You can add a activex label over the images in order to detect move position.

    The really hard part is determining which country the mouse position related to. You can use a simple box area approach but that may not be fine enough control.
    You will also need images of the country highlighted or not and toggle the visibility of that shape.

    See here for examples

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. Image Pop Up on Mouse Hover over image on userform
    By mc84excel in forum Excel Programming / VBA / Macros
    Replies: 6
    Last Post: 03-31-2019, 04:43 PM
  2. About the mouse over the image
    By Strsh in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 03-06-2018, 06:52 PM
  3. Replies: 0
    Last Post: 03-06-2013, 12:52 PM
  4. Show image on mouse over in another cell
    By kkostas in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 10-15-2012, 01:12 PM
  5. Replies: 1
    Last Post: 05-16-2011, 08:07 AM
  6. Image Popup when mouse arrow hovers on Button
    By ravinder_tigh in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 10-06-2009, 11:13 AM

Tags for this Thread


Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1