Comments vs Note Text Excel Add-in with code example

Comments vs Note Text Excel Add-in with code example


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.


Range.NoteText(Text, Start, Length)


  1. Text: Refers to a running string which can be up to 255 character long.
  2. Start: Refers to start position from where we want to retrieve text from a NoteText.
  3. 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:=" is a complete solution"
    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: " is a complete solution");


Next >> Understand Comments in Excel with code example

Leave a Reply

Your email address will not be published. Required fields are marked *