NoteText Method

Applies To

Range Object.

Description

Returns or sets the cell note associated with the upper-left cell in this range. Read-write.

Syntax

object.NoteText(text, start, length)

object

Required. The range to which this property applies.

text

Optional. If specified, contains the text to add to the note (up to 255 characters). The text is inserted starting at position start, replacing length characters of the existing note. If this argument is omitted, this method returns the current text of the note starting at position start, for length characters.

start

Optional. Specifies the starting position for the set or returned text. If omitted, this method starts at the first character. This argument is omitted if there is no existing note. Specify a number larger than the number of characters in the existing note to append text to the note.

length

Optional. Specifies the number of characters to set or return. If this argument is omitted, Microsoft Excel sets or returns characters from the start position to the end of the note (up to 255 characters) If there are more than 255 characters from start to the end of the note, this method returns only 255 characters.

Remarks

To add a note containing more than 255 characters, use this method once to specify the first 255 characters, then append the remainder of the note 255 characters at a time.

See Also

ClearNotes Method.

Example

This example sets the cell note text for cell A1 on Sheet1.


Worksheets("Sheet1").Range("A1").NoteText "This may change!"