Ago
11-24-2008, 04:05 AM
i have a code that creates a string, textstr, in a loop.
when the string is complete i use this code to place the string in cellcommments.
For k = 1 To j
With Range("G" & i + k - 1)
.AddComment
.Comment.Text Text:=textstr
.Comment.Shape.TextFrame.AutoSize = True
End With
Next k
it feels ridicilous to have a loop when i know which cells should have this string.
is there any way i could use something like
Range("G" & i, "G" & i+j).AddComment
Range("G" & i, "G" & i+j).Comment.Text Text:=textstr
Range("G" & i, "G" & i+j).Comment.Shape-TextFrame.Autosize = True
but it seems comments can only be added one at the time.
any suggestions?
when the string is complete i use this code to place the string in cellcommments.
For k = 1 To j
With Range("G" & i + k - 1)
.AddComment
.Comment.Text Text:=textstr
.Comment.Shape.TextFrame.AutoSize = True
End With
Next k
it feels ridicilous to have a loop when i know which cells should have this string.
is there any way i could use something like
Range("G" & i, "G" & i+j).AddComment
Range("G" & i, "G" & i+j).Comment.Text Text:=textstr
Range("G" & i, "G" & i+j).Comment.Shape-TextFrame.Autosize = True
but it seems comments can only be added one at the time.
any suggestions?