how do I paste excel text into a comment box?

B

Bonnie

I have data in excel in muliple rows and columns, I want to copy this data
and paste it into a comment. Any suggestions?
 
G

Gary''s Student

Select the cells (any rows or columns) and run this macro:

Sub commentset()
Dim r As Range
Dim s As String
s = ""
For Each r In Selection
s = s & r.Value
Next
With Range("K9")
.AddComment
.Comment.Visible = False
.Comment.Text Text:=s
End With
End Sub

I picked K9 as the destination to hold the comment, you can pick anything
you want.
 
Top