hermesalpha
asked on
For a cell in Excel overfilled with text that can't be displayed in full, what is the best way to display all text upon hovering with the mouse or selected with cursor?
For a cell in Excel overfilled with text that can't be displayed in full, what is the best way to display all text upon hovering with the mouse or selected with cursor?
For example, if I use Data/Data validation/Input message, is it possible to make this dynamic so that the message displayed is what the cell contains?
Or would I need to use VBA? For example if I could use VBA for getting each cell to autosize itself when the cell is selected or hovered over with the mouse pointer, would that be possible?
In other words, the cell's size is too small to display all the contents, and I want all contents in it to be displayed when the cell is selected with the cursor or hovered over with the mouse pointer.
I have Excel 2007.
For example, if I use Data/Data validation/Input message, is it possible to make this dynamic so that the message displayed is what the cell contains?
Or would I need to use VBA? For example if I could use VBA for getting each cell to autosize itself when the cell is selected or hovered over with the mouse pointer, would that be possible?
In other words, the cell's size is too small to display all the contents, and I want all contents in it to be displayed when the cell is selected with the cursor or hovered over with the mouse pointer.
I have Excel 2007.
How many characters are in these cells? Would it be sufficient to resize the formula bar (drag the bottom edge down) or just to format the cells as wrap text?
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
How about adding a comment to cells with long text? That way, the mouse hover will show the text.
Here's an example of what I mean by widening the formula bar. It should work even for extraordinarily long text and it will always show the text in the current cell. You do lose a little real estate out of the cell grid but if you're main interest is the text in the current cell then it probably doesn't matter.
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
Sorry for not replying until now. This looks great, will try it out in the weekend.
ASKER
I tried below VBA code instead, and it worked fine except that the whole comment gets displayed on one single long row only. So the comment disappears in the right side of the screen.
Would it be possible to make some changes to this code below so the comment's width and height adjust automatically according to how close the selected cell is to the right margin of the screen and to the bottom margin of the screen (the closer to the right margin of the screen, the less the width would be; and the closer to the bottom margin of the screen, the less the height would be)?
This is the VBA code (which worked fine, except this detail that the comment gets displayed on a long single row only):
Private Sub Worksheet_SelectionChange( ByVal Target As Range)
If Target.Count > 1 Then Exit Sub
Dim str As String
On Error Resume Next
str = Target.Value
Cells.ClearComments
If Target <> "" Then
Target.AddComment str
Target.Comment.Visible = True
Target.Comment.Shape.TextF rame.AutoS ize = True
On Error Resume Next
If Target.Validation.Type <> 3 Then Exit Sub
On Error GoTo 0
With Target.Validation
.InputMessage = Target.Value
End With
End If
End Sub
Would it be possible to make some changes to this code below so the comment's width and height adjust automatically according to how close the selected cell is to the right margin of the screen and to the bottom margin of the screen (the closer to the right margin of the screen, the less the width would be; and the closer to the bottom margin of the screen, the less the height would be)?
This is the VBA code (which worked fine, except this detail that the comment gets displayed on a long single row only):
Private Sub Worksheet_SelectionChange(
If Target.Count > 1 Then Exit Sub
Dim str As String
On Error Resume Next
str = Target.Value
Cells.ClearComments
If Target <> "" Then
Target.AddComment str
Target.Comment.Visible = True
Target.Comment.Shape.TextF
On Error Resume Next
If Target.Validation.Type <> 3 Then Exit Sub
On Error GoTo 0
With Target.Validation
.InputMessage = Target.Value
End With
End If
End Sub
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Glad to be of assistance. Thanks for the feedback.