Loading
Ozgrid Excel Help & Best Practices Forums

Excel Video Tutorials / Excel Dashboards Reports



Page 1 of 2 1 2 LastLast
Results 1 to 10 of 12

Thread: Excel mouseOver event or something else?

  1. #1
    Join Date
    3rd September 2010
    Posts
    34

    Excel mouseOver event or something else?

    Wondering if there is a way to have a popup box (besides a comment) when a mouse goes over a cell with predefined data? I have 200-250 cells with data that I want hidden. This spreadsheet is a practice test where I need to enter the data my self. Ill say in my mind what should be in the cell and then put the mouse over the cell for a popup and see if what I was thinking is the right answer. I can make all the text white so no one can see it in the cell, then run the mouse over the cell and a popup with the same text will popup in black font? Any ideas?

    Excel Video Tutorials / Excel Dashboards Reports


  2. #2
    Join Date
    19th January 2007
    Location
    South Carolina, USA
    Posts
    9,206

    Re: Excel mouseOver event or something else?

    It requires the use of VBA, using the worksheet_SelectionChange event. There is no mouse-over event in Excel.

    Something along the lines of:

    VB:
    Option Explicit 
     
    Private Sub Worksheet_SelectionChange(ByVal Target As Range) 
         
        If Not Intersect(Target, Range("A1:E100")) Is Nothing Then 
            MsgBox Target.Value 
        End If 
         
    End Sub 
    
    
    Adjust the range per your actual workbook ranges.
    AAE
    ----------------------------------------------------

    Forum Rules | Message to Cross Posters | How to use Tags

  3. #3
    Join Date
    3rd September 2010
    Posts
    34

    Re: Excel mouseOver event or something else?

    Thanks for the quick reply. I need to sound really noob. Do I add this into the screen that pops up when I press ALT + F11? Im new to coding. Good at excel, but not adding stuff like this. Thanks for your help.

    Excel Video Tutorials / Excel Dashboards Reports


  4. #4
    Join Date
    19th January 2007
    Location
    South Carolina, USA
    Posts
    9,206

    Re: Excel mouseOver event or something else?

    Right-click the worksheet tab and choose View Code, then copy/paste the code. Don't forget to adjust the range references, if needed.
    AAE
    ----------------------------------------------------

    Forum Rules | Message to Cross Posters | How to use Tags

  5. #5
    Join Date
    3rd September 2010
    Posts
    34

    Re: Excel mouseOver event or something else?

    sweet. I like it but can there be a floating popup? Like it only shows up as the mouse is over the cell and if you move the mouse to the next cell it pops up wiht the new cells value? Right now you have to click the cell and the popup shows up, then click "ok" to close the popup. minor details but so far a great help!! thanks.

    Excel Video Tutorials / Excel Dashboards Reports


  6. #6
    Join Date
    19th January 2007
    Location
    South Carolina, USA
    Posts
    9,206

    Re: Excel mouseOver event or something else?

    As I mentioned, there IS NOT a mouse-hover or mouse-over event. The closest you are going to come, without selecting cells is to add a comment box to all the cells and populate the comment box with the cell value. Then you can mouse over the cell and display the content in the comment box.

    VB:
    Option Explicit 
     
    Sub Set_Comment_to_Cell_Value() 
         
        Dim c As Range 
         
        Application.ScreenUpdating = False 
         
        For Each c In Range("A1:E100") 
            c.AddComment Text:=c.Value 
        Next c 
         
        Application.ScreenUpdating = True 
         
    End Sub 
    
    
    AAE
    ----------------------------------------------------

    Forum Rules | Message to Cross Posters | How to use Tags

  7. #7
    Join Date
    3rd September 2010
    Posts
    34

    Re: Excel mouseOver event or something else?

    Ill just deal with what it is. Looks good enough for me. I have another post that Im struggling with yif your really bored. I dont know scripting so I cant do much. I had one guy help quite a bit, but if you want to check it out. its out there.

    Excel Video Tutorials / Excel Dashboards Reports


  8. #8
    Join Date
    19th January 2007
    Location
    South Carolina, USA
    Posts
    9,206

    Re: Excel mouseOver event or something else?

    If you have another thread in which you want help, then provide a link to the thread in your post or bump the thread if you haven't gotten a response or solution.
    AAE
    ----------------------------------------------------

    Forum Rules | Message to Cross Posters | How to use Tags

  9. #9
    Join Date
    9th September 2009
    Posts
    1,599

    Re: Excel mouseOver event or something else?

    There is an idea that I think could be made to work. I don't have time to play around and write it at the moment, and what follows is probably a bit advanced for you, but someone else may grab the idea and give it a go:

    You can lay a Forms Image over the cells you want to potentially have the tool-tip for. You then set the Backstyle of this to fmBackStyleTransparent. A forms object has the MouseMove event. With some care and a fair amount of coding you can work out when the mouse is over a particular cell and then bring up a shape containing your text that tracks the pointer.

    VB:
    Option Explicit 
     
    Private Sub Image1_MouseMove(ByVal Button As Integer, ByVal Shift As Integer, ByVal X As Single, ByVal Y As Single) 
        With ActiveSheet.Shapes(2) 
            .Left = X 
            .Top = Y 
        End With 
    End Sub 
    
    
    Take a look at this but don't be mistaken, this is not 'nearly there' to turn it into what you want requires quite a bit of work, but in theory it could be done.
    Attached Files. REMINDER! OzGrid accepts no responsibility for ANY adverse effects as a result from downloading attached files. ALWAYS run an up-to-date virus scan and disable macros.

  10. #10
    Join Date
    3rd September 2010
    Posts
    34

    Re: Excel mouseOver event or something else?

    Got it. Let me see if I can make sense of your code. Thanks for all your help.

    Excel Video Tutorials / Excel Dashboards Reports


Thread Information

Users Browsing this Thread

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

Possible Answers

  1. mouseover
    By goldcoin in forum EXCEL HELP
    Replies: 2
    Last Post: July 1st, 2005, 09:17
  2. mouseover on label
    By nem123 in forum EXCEL HELP
    Replies: 10
    Last Post: January 20th, 2005, 05:31
  3. [Solved] VBA: Office Assistant MouseOver
    By xlite in forum EXCEL HELP
    Replies: 5
    Last Post: October 3rd, 2003, 01:15
  4. mouseover comment
    By codemonkey in forum EXCEL HELP
    Replies: 2
    Last Post: May 27th, 2003, 20:29

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
  •  
porno