Article ID: 142119
Article Last Modified on 10/11/2006
Sub GetCellNote()
Dim Box As Object, X As Integer
' Check to see if a Note is in the Active Cell.
If Len(ActiveCell.NoteText(Start:=X * 255 + 1)) = 0 Then
MsgBox "There is not a note in the Active Cell.", vbExclamation
Exit Sub
End If
' Add a text box.
Set Box = ActiveSheet.TextBoxes.Add(ActiveCell.Offset(1, 1).Left, _
ActiveCell.Offset(1, 1).Top, ActiveCell.Offset(1, 3).Left, _
ActiveCell.Offset(6, 1).Top)
' We can only get 255 Characters at a time; so, loop until all of
' the note is retrieved.
Do Until Len(ActiveCell.NoteText(Start:=X * 255 + 1)) = 0
Box.Characters(X * 255 + 1).Text = _
ActiveCell.NoteText(Start:=X * 255 + 1)
X = X + 1
Loop
End Sub
To use the preceding macro in Microsoft Excel 97 or Microsoft Excel 98,
point to Macro on the Tools menu, and then click Macros. (In earlier versions, click the cell that contains the note, and then click Macro on the Tools menu.) Click the GetCellNote macro, and then click Run. If necessary, size the text box such that you can view the entire note.
Additional query words: 8.00 XL97 XL98 XL7 XL5
Keywords: kbdtacode kbhowto kbprogramming KB142119