+ Reply to Thread
Results 1 to 3 of 3

Code to change shape colour with mouse hover

  1. #1
    Registered User
    Join Date
    12-19-2013
    Location
    melbourne
    MS-Off Ver
    Excel 2003
    Posts
    2

    Code to change shape colour with mouse hover

    hi,

    does someone know code to change shape colour on mouse over and then revert back when mouse off. need to able to add a hyperlink to another part of the workbook.

    thanks

  2. #2
    Forum Expert
    Join Date
    01-23-2013
    Location
    USA
    MS-Off Ver
    Microsoft 365 aka Office 365
    Posts
    3,863

    Re: Code to change shape colour with mouse hover

    Hi lorettag1966,

    Great question, that requires some trickery to solve your problem. The solution is courtesy of Andy Pope circa 2003: http://www.ozgrid.com/forum/showthread.php?t=17212

    There are no 'Shape' mouse events. I had to cover the 'Shape' with two transparent 'Active X' Labels:
    a. Active X Label1 is on top of the Shape and is slightly larger than the shape.
    b. Active X Label1X is behind the Shape and is slightly larger than Label1.

    When a Label1_MouseMove() event occurs, the Shape can be colored.
    When a Label1X_MouseMove() event occurs, the Shape can be colored again (back to the original color).

    The only code involved is the Sheet mouse event code:
    Please Login or Register  to view this content.
    See the attached working sample workbook.

    Lewis
    Attached Files Attached Files

  3. #3
    Registered User
    Join Date
    12-19-2013
    Location
    melbourne
    MS-Off Ver
    Excel 2003
    Posts
    2

    Re: Code to change shape colour with mouse hover

    thankyou...works a treat.

+ 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. Excel VBA code to automatically change colour shape based on time
    By afzal_u1 in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 11-28-2013, 10:28 AM
  2. [SOLVED] to change shape colour by conditional formating/ VBA
    By asmi in forum Excel Programming / VBA / Macros
    Replies: 19
    Last Post: 11-08-2013, 03:57 AM
  3. [SOLVED] How to make 'button' change colour when hover over them
    By danlRB80 in forum Excel Programming / VBA / Macros
    Replies: 21
    Last Post: 09-11-2013, 06:17 AM
  4. Need to change the colour of a shape according to its value
    By hawkinsr86 in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 11-08-2012, 02:42 AM
  5. Hover over button and change it's colour
    By gpcool in forum Excel Programming / VBA / Macros
    Replies: 11
    Last Post: 03-15-2008, 05:37 PM

Bookmarks

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