+ Reply to Thread
Results 1 to 4 of 4

On Mouse On - With VBA Code

  1. #1
    Registered User
    Join Date
    01-25-2005
    Posts
    16

    Unhappy On Mouse On - With VBA Code

    Hi Every One,

    Can some one tell me if it is possible to make de following:

    In the column A I have a list of product code, I would like to get the possibility one I put the Mouse on one cell (without clicking/entering the cell) to get the description of the code. this description can apear any where.

  2. #2
    Valued Forum Contributor Charles's Avatar
    Join Date
    02-10-2004
    Location
    Biloxi
    MS-Off Ver
    Windows 7, Excel 2003,2007 & Mac2011
    Posts
    845
    Hi,

    You can use the "Comment" feature of the worksheet.
    When the "Mouse is over the cell the Comment shuld appear.
    To use click "Insert" select "Comment" then enter info.

    HTH

    Charles

  3. #3
    Registered User
    Join Date
    01-25-2005
    Posts
    16

    Question On Mouse On - With VBA Code

    Hi,

    My ideia is to do this dynamicaly. Because i have in the 2nd Sheet a table with 1200 rows (column A : Code and column B : Description)???

  4. #4
    Forum Contributor
    Join Date
    11-29-2003
    Posts
    1,203
    Code for the code window of Sheet1:

    Private Sub Worksheet_SelectionChange(ByVal Target As Range)
    If Target.Column = 1 Then
    Call InsertDescription(Target)
    End If
    End Sub


    Code to be placed in a separate module:

    Sub InsertDescription(myRange As Range)
    Dim myCell As Range, SearchRange As Range, Description As String

    Set myCell = myRange.Cells(1)
    myVal = myCell.Value

    Set SearchRange = Sheet2.Columns("A:A")
    Set ResultRange = Sheet2.Columns("B:B")
    matchRow = 0
    On Error Resume Next
    matchRow = Application.WorksheetFunction.Match(myVal, SearchRange, 0)
    If matchRow > 0 Then
    Description = Sheet2.Range("B" & matchRow)
    Else:
    Description = "Not Found"
    End If

    myCell.AddComment
    myCell.Comment.Visible = False
    myCell.Comment.Text Text:=Description

    End Sub

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

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