kholder_33
New Member
- Joined
- Oct 29, 2022
- Messages
- 2
- Office Version
- 365
- Platform
- Windows
Hello everyone,
This is my first post/question.
I am a novice beginner who has taught myself.
I have a code that does what I want it to do BUT......
When the macro is run the text box does not clear when cell contents are cleared.
I would also like for the macro to run automatically when any cell in the range C8:C82 is selected.
Can someone edit this code or come up with a new one or different method?
Thank you.
This is my first post/question.
I am a novice beginner who has taught myself.
I have a code that does what I want it to do BUT......
When the macro is run the text box does not clear when cell contents are cleared.
I would also like for the macro to run automatically when any cell in the range C8:C82 is selected.
Can someone edit this code or come up with a new one or different method?
Thank you.
VBA Code:
Sub HoverCellShowContents_Text()
Dim row_no As Integer
For row_no = 8 To 83
With Cells(row_no, 3)
If ActiveSheet.Cells(row_no, 3).Value <> "" Then
.ClearComments
.AddComment
.Comment.Visible = False
.Comment.Text Text:=Cells(row_no, 3).Value
.Comment.Shape.ScaleWidth 3, msoFalse, msoScaleFromTopLeft
.Comment.Shape.ScaleHeight 5, msoFalse, msoScaleFromTopLeft
End If
End With
Next
End Sub
Last edited by a moderator: