+ Reply to Thread
Results 1 to 7 of 7

Tooltip Look Up - Mouseover or Click

Hybrid View

  1. #1
    Registered User
    Join Date
    11-23-2012
    Location
    London, England
    MS-Off Ver
    Excel 2007
    Posts
    6

    Cool Tooltip Look Up - Mouseover or Click

    I'm looking at condensing a wide worksheet, 100 columns of specific location names, into something more aesthetically pleasing.

    I have a list that contains a location name and it's corresponding acronym. When a user mouses over the acronym on the worksheet with the 100 columns I'd like for the location name to display. I've mocked up an example and attached it.

    Furthermore, is there a non VBA solution. I tried searching for lookups and data validation to no avail.


    I feel that clicking into the cell and the tooltip displaying may be easier for our end user; however, share your thoughts.

    Thanks!
    Attached Files Attached Files
    Last edited by ricky2k2; 07-28-2017 at 11:39 AM. Reason: solved thanks

  2. #2
    Forum Expert CK76's Avatar
    Join Date
    06-16-2015
    Location
    ONT, Canada
    MS-Off Ver
    MS365 Apps for enterprise
    Posts
    5,913

    Re: Tooltip Look Up - Mouseover or Click

    Other than manually creating Comment notes... you'd need VBA.

    Here's sample code.
    In Standard Module:
    Public ldic As Object
    Sub fillDic()
    Set ldic = CreateObject("Scripting.Dictionary")
    myArr = Sheets("Locations").UsedRange.Value
    
    For i = 1 To UBound(myArr)
        ldic(myArr(i, 2)) = myArr(i, 1)
    Next
    
    End Sub
    In Workbook module:
    Private Sub Workbook_Open()
    If ldic Is Nothing Then Call fillDic
    End Sub
    Then in Worksheet Module for "Data" sheet:
    Private Sub Worksheet_SelectionChange(ByVal Target As Range)
    Static OldRange As Range
    On Error Resume Next
    
    If ldic Is Nothing Then Call fillDic
    If Target.Count > 1 Then Exit Sub
    If Not Intersect(Target, Range("1:1")) Is Nothing Then
        If Not OldRange Is Nothing Then OldRange.Comment.Delete
        Target.AddComment "Location:" & ldic(Target.Value)
        Set OldRange = Target
    End If
    
    End Sub
    See attached.
    Attached Files Attached Files
    ?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 Expert MickG's Avatar
    Join Date
    11-23-2007
    Location
    Banbury,Oxfordshire
    Posts
    2,650

    Re: Tooltip Look Up - Mouseover or Click

    If you run the code below (Just Once) you will create a Hyperlink "ToolText" for the Cells in sheet "Data" row 1.
    Each cell in row 1 of sheet data will have a "ToolTip" text relating to Location name in column 1 of sheet "Locations".

    Sub MG27Jul20
    Dim Rng As Range, Dn As Range, n As Long, nRng As Range
    With CreateObject("scripting.dictionary")
    .CompareMode = vbTextCompare
    With Sheets("Locations")
        Set Rng = .Range(.Range("B2"), .Range("B" & Rows.Count).End(xlUp))
    End With
    With Sheets("Data")
        Set nRng = .Range(.Range("B1"), Cells(1, Columns.Count).End(xlToLeft))
    End With
    
    For Each Dn In Rng: .Item(Dn.Value) = Dn.Offset(, -1): Next
        For Each Dn In nRng
            ActiveSheet.Hyperlinks.Add Dn, "", "", ScreenTip:=.Item(Dn.Value) 
        Next Dn
    End With
    End Sub
    Regards Mick

  4. #4
    Forum Expert CK76's Avatar
    Join Date
    06-16-2015
    Location
    ONT, Canada
    MS-Off Ver
    MS365 Apps for enterprise
    Posts
    5,913

    Re: Tooltip Look Up - Mouseover or Click

    ...create a Hyperlink...
    Nice! I like it much better than comments.

  5. #5
    Forum Expert MickG's Avatar
    Join Date
    11-23-2007
    Location
    Banbury,Oxfordshire
    Posts
    2,650

    Re: Tooltip Look Up - Mouseover or Click

    Thanks for the feedback
    Regrds Mick

  6. #6
    Registered User
    Join Date
    11-23-2012
    Location
    London, England
    MS-Off Ver
    Excel 2007
    Posts
    6

    Re: Tooltip Look Up - Mouseover or Click

    Thank you solved.

  7. #7
    Forum Expert MickG's Avatar
    Join Date
    11-23-2007
    Location
    Banbury,Oxfordshire
    Posts
    2,650

    Re: Tooltip Look Up - Mouseover or Click

    You're welcome

+ 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. Tooltip on picture
    By Mart Marti in forum Excel Programming / VBA / Macros
    Replies: 7
    Last Post: 06-22-2015, 12:45 PM
  2. Replies: 0
    Last Post: 10-11-2012, 04:18 AM
  3. Use a tooltip.
    By sparrow1 in forum Excel General
    Replies: 6
    Last Post: 02-04-2007, 06:30 PM
  4. tooltip like box
    By Jack Zhong in forum Excel General
    Replies: 2
    Last Post: 08-20-2006, 05:45 AM
  5. Multiline Tooltip
    By RobC in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 05-02-2006, 05:35 PM
  6. Tooltip for my CommandButton
    By LQs in forum Excel General
    Replies: 1
    Last Post: 12-02-2005, 06:00 AM
  7. Tooltip for mouseover of Image OLEObject (from Control Toolbar)
    By Matt Jensen in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 01-08-2005, 10:06 AM

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