I form a string and put that string into a selected cell as a comment. Mostly it works fine but as the string gets over a certain length (255 characters?), the string gets "truncated" in that only the characters over that length get put into the comment.
Here's the code that I use:
Public Sub getBellTimes()
Dim cmnt As Comment
Dim sStr As String
sStr = "Bell Schedule" + Chr(10) + " AM" + Chr(10)
...code to further develope the sStr value...
MsgBox sStr
MsgBox Len(sStr)
ActiveSheet.Range("hold").AddComment (sStr)
Set cmnt = ActiveSheet.Range("hold").Comment
With cmnt.Shape.TextFrame
.Characters.Text = ""
.AutoSize = True
.Characters.Text = sStr
End With
End Sub
The sStr variable is correctly formed (as seen with the msgBox) prior to the time that I try to put it into the comment.
Any ideas what I'm doing wrong?
TIA.
Bob
Bookmarks