+ Reply to Thread
Results 1 to 9 of 9

Mouse over a cell to hightlight the cell

  1. #1
    Forum Contributor
    Join Date
    10-03-2012
    Location
    USA
    MS-Off Ver
    2010
    Posts
    496

    Mouse over a cell to hightlight the cell

    Hi
    Mouse over a cell to hightlight the cell in B4:F5, click the cell then add or modified the text.
    Once the mouse rolls away from that cell, the background color will reset back to
    it's orginal color.

    Thanks
    Last edited by Rocky2013; 04-11-2015 at 11:25 AM.

  2. #2
    Forum Expert JasperD's Avatar
    Join Date
    05-07-2013
    Location
    Netherlands
    MS-Off Ver
    Excel 2016
    Posts
    1,393

    Re: Mouse over a cell to hightlight the cell

    There is no 'onmouseover' event in vba.
    However, you can use a (complicated) workaround to (sort-of) do what you want.
    How desperate are you for this functionality?

  3. #3
    Forum Expert JasperD's Avatar
    Join Date
    05-07-2013
    Location
    Netherlands
    MS-Off Ver
    Excel 2016
    Posts
    1,393

    Re: Mouse over a cell to hightlight the cell

    Ok, step #1 for the highlighting (works on your sample sheet)
    Put the following code into a module

    Please Login or Register  to view this content.
    Then in the cells surrounding your table (so A3:G3, A5:G5, A4 and G4) put something like this (make sure to fill up the cell):
    =IFERROR(HYPERLINK(OnMouseOver(ADDRESS(ROW(),COLUMN())),""), "##########")
    and format those cells with white font color, so you don't see them.

    Then in your table in range("B4:F5"), put the following in each cell.
    For the cell you want to display "1" put : =IFERROR(HYPERLINK(OnMouseOver(ADDRESS(ROW(),COLUMN()))), "1")
    For the cell you want to display "2" put : =IFERROR(HYPERLINK(OnMouseOver(ADDRESS(ROW(),COLUMN()))), "2")

    etc.

    Let me know if that does the trick for you.
    Please click the * below if this helps

  4. #4
    Forum Contributor
    Join Date
    10-03-2012
    Location
    USA
    MS-Off Ver
    2010
    Posts
    496

    Re: Mouse over a cell to hightlight the cell

    Hello,
    I add your code, attached. It does work to highlight cell when mouse over.
    Only thing that if I have to make a change, I will need to see the whole formula,
    then make change within "XXXXXXXXX". For me is OK but for other who would
    use this, they may type over to change the text and override the formula.
    I like to see just the text, then hyperlink mouse over formula is in vba (background).
    Maybe there is an issue likely you saying coding in vba.

    Also is there a way to "undo" after the text is changed?

    Thanks
    Attached Files Attached Files

  5. #5
    Forum Expert JasperD's Avatar
    Join Date
    05-07-2013
    Location
    Netherlands
    MS-Off Ver
    Excel 2016
    Posts
    1,393

    Re: Mouse over a cell to hightlight the cell

    Well, editing the 'value' on click is a bit tricky.
    The best way I can come up with is to protect the sheet (but allow formatting of cells) and then put the following code in the worksheet area of the code.

    Please Login or Register  to view this content.
    Then, if they click or double click the cell, they'll get an inputbox asking for the new value to put in the cell.
    It would look cleaner if you format the cells as hidden too, so people don't actually see the formula.

    As for undoing all of that, it's possible too, it just requires you to keep a 'database' of changes, probably in a global variable.

    Now, if you're not too busy, consider clicking the * below if this helps you

  6. #6
    Forum Contributor
    Join Date
    10-03-2012
    Location
    USA
    MS-Off Ver
    2010
    Posts
    496

    Re: Mouse over a cell to hightlight the cell

    It solved some problem. It works, but some time when I change the text, a pop-up message "can not open the spefified file."
    shows up. Text changes if I click OK. Just little ignoring. I do not why pop-up does randomly but not every time.
    It pop-ups whether the sheet is protected or not.

    It is nice to fix to avoid wrong message, otherwise the code works.

    Please advise

    Thanks

  7. #7
    Forum Expert JasperD's Avatar
    Join Date
    05-07-2013
    Location
    Netherlands
    MS-Off Ver
    Excel 2016
    Posts
    1,393

    Re: Mouse over a cell to hightlight the cell

    Can't be fixed.

  8. #8
    Forum Contributor
    Join Date
    10-03-2012
    Location
    USA
    MS-Off Ver
    2010
    Posts
    496

    Re: Mouse over a cell to hightlight the cell

    Thanks for help.

  9. #9
    Forum Expert JasperD's Avatar
    Join Date
    05-07-2013
    Location
    Netherlands
    MS-Off Ver
    Excel 2016
    Posts
    1,393

    Re: Mouse over a cell to hightlight the cell

    You're welcome. Thanks for the rep.
    The reason it can't be fixed is because the 'mouseover' hack is initiated by a hyperlink.
    Sadly, there's no way in excel to turn off hyperlink following on click.

    Unless someone else has a bright idea?

+ 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. Auto Hightlight Entire Row - only when active cell is on specific columns
    By John19 in forum Excel Programming / VBA / Macros
    Replies: 11
    Last Post: 01-11-2015, 02:18 AM
  2. Macro that will hightlight a cell and four rows to right based on text in cell:
    By Chad Bateman in forum Excel Programming / VBA / Macros
    Replies: 10
    Last Post: 08-07-2014, 02:13 PM
  3. [SOLVED] Hightlight a range of row then a cell selected
    By HaroonSid in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 04-02-2014, 08:50 AM
  4. [SOLVED] Hightlight a range of row when a cell selected Solved by : sktneer
    By HaroonSid in forum Excel Programming / VBA / Macros
    Replies: 11
    Last Post: 04-02-2014, 08:37 AM
  5. cell data not validated if navigating cell to cell with mouse
    By LoveThatMouse in forum Excel Formulas & Functions
    Replies: 6
    Last Post: 05-21-2006, 04:10 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