Add Comments to Cells with an Excel Macro

Add to Favorites

Add comments to cells in Excel with this macro. This allows you to quickly and easily add a comment to any cell within a worksheet or workbook in Excel.

In order to use this macro simply replace the A1 cell reference with the range object with the cell that you want to add a comment to and also replace the text This is my comment. with the text that you would like included in the comment. Make sure to put your comment within the quotation marks in the macro.

Where to install the macro:  Module

Excel Macro to Add Comments to Cells

Sub Add_Comment()
'Adds a comment to cell A1 in Excel

Range("A1").AddComment ("This is my comment.")

End Sub

How to Install the Macro
  1. Select and copy the text from within the grey box above.

  2. Open the Microsoft Excel file in which you would like the Macro to function.

  3. Press "Alt + F11" - This will open the Visual Basic Editor - Works for all Excel Versions.  Or For other ways to get there, Click Here.

  4. On the new window that opens up, go to the left side where the vertical pane is located. Locate your Excel file; it will be called VBAProject (YOUR FILE'S NAME HERE) and click this.

  5. If the Macro goes in a Module, Click Here, otherwise continue to Step 8.

  6. If the Macro goes in the Workbook or ThisWorkbook, Click Here, otherwise continue to Step 8.

  7. If the Macro goes in the Worksheet Code, Click Here, otherwise continue to Step 8.

  8. Close the Microsoft Visual Basic Editor window and save the Excel file. When you close the Visual Basic Editor window, the regular Excel window will not close.

  9. You are now ready to run the macro.

Excel Forum