|Excel And SQL .com|
Home > VBA Macros
How to add a comment to a cell
Adding comments to cells to describe the information contained with in the cell. This provides a quick way for the user to get help with out leaving excel. Excel gives a visual indicator on the top right corner if the cell contains a comment.
Sub AddComments() 'Clear any comment already assigned to the cell Range("B5").ClearComments 'Add a comment to cell B5 Range("B5").AddComment ("This is a comment ") Cells(2, 10).ClearComments Cells(2, 10).AddComment ("This is another comment") 'Clear any comment already assigned to the cell Range("A1:B2").ClearComments 'You can not assign comment to more than one cell at a time. 'Below statement generates an error if you run it. 'Range("A1:B2").AddComment ("This is a comment ") End Sub
|© All Rights Reserved. ExcelAndSql.com|