• Hi All

    Please note that at the Chandoo.org Forums there is Zero Tolerance to Spam

    Post Spam and you Will Be Deleted as a User

    Hui...

  • When starting a new post, to receive a quicker and more targeted answer, Please include a sample file in the initial post.

Displaying a large amount of text in one cell by hovering.

hotcomper

New Member
Good morning, I use a workbook that basically has a few cells with just a few words and some that contain a lot of text. When we use this for presenting we sometimes need to see the full content of the cell. Is there a quick way of displaying this? Ideally I would just want to hover over the cell and the full content is displayed without having to click in.
TIA
 

Attachments

  • Workbook1.xlsx
    31.1 KB · Views: 8
In the attached, I have placed a form that is opened when you double click on a cell. The form opens and contains the contents of the cell you double click on. Additionally, you can zoom the size of the font in the form for easier reading.
 

Attachments

  • Workbook1.xlsm
    17.6 KB · Views: 15
I don't believe there's native event trigger on mouse hover.

I'd just use selection change, or like Alan did, double click.

Here's sample code using Range.Comment.
Code:
Private Sub Worksheet_SelectionChange(ByVal Target As Range)
Dim cmt As Comment
Static oldRange As Range
If Target.Count > 1 Then Exit Sub
If Len(Target.Value) > 15 Then
    Set cmt = Target.Comment
    If cmt Is Nothing Then
        Set cmt = Target.AddComment
    End If
    With cmt
        .Text Target.Text
        .Shape.TextFrame.AutoSize = True
        .Visible = True
    End With
End If
If Not oldRange Is Nothing Then
    Set cmt = oldRange.Comment
    If Not cmt Is Nothing Then
        cmt.Delete
    End If
End If
Set oldRange = Target.Cells(1, 1)
End Sub
Note: this will probably show comment in single line. May want to adjust height of TextFrame as needed.
 
Back
Top