NoteText
Note Text method is a replaced by comments object in Excel. It behaves like comments in a cell. It is visible at the right top corner of a cell. Comments in excel inserts author information but Note Text only has text.
Syntax
Range.NoteText(Text, Start, Length)
Parameters
- Text: Refers to a running string which can be up to 255 character long.
- Start: Refers to start position from where we want to retrieve text from a NoteText.
- Length: Refers to number of characters you would like to retrieve from a NoteText.
VBA code example
Public Sub InsertNoteText() 'Declare range object Dim oRange As Range 'Bind selection to range Set oRange = Selection 'Add note text oRange.NoteText Text:="www.VBAOVERALL.com is a complete solution" 'Cleanup If Not oRange Is Nothing Then Set oRange = Nothing End If End Sub
C# code example
private void btnInsertNoteText_Click(object sender, RibbonControlEventArgs e) { //Retain selection excel.Range oRange = Globals.ThisAddIn.Application.Selection; //Insert NoteText oRange.NoteText(Text: "www.VBAOVERALL.com is a complete solution"); }
Output

Next >> Understand Comments in Excel with code example