Name

range.NoteText([Text], [Start], [Length])

Synopsis

Sets or returns the text of the note for the first cell in the specified range.

Argument

Settings

Text

The text of the note

Start

The position of the first character within the note to set or return

Length

The number or characters to set or return

The following code adds a note if the specified cell is greater than the specified value:

With ActiveSheet.Range("B3")
    If .Value >= 0.3 Then
        .NoteText "All Star!"
    End If
End With

Get Programming Excel with VBA and .NET now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.