Add Comments to Cells with an Excel Macro

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

Select and copy the text from within the grey box above.

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

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

For Excel 2007Go to Office Button > Excel Options > Popular > Click Show Developer tab in the Ribbon. Then go to the Developer tab on the ribbon menu and on the far left Click Visual Basic

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.

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

Go to the menu at the top of the window and click Insert > Module

Another window should have opened within the Visual Basic Editor's window. Within this new window, paste the macro code. Make sure to paste the code underneath the last line of anything else that is in the window.

Go to Step 8.

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

Then, at the bottom of the list that appears, double-click the ThisWorkbook text.

A new window inside the Visual Basic Editor's window will appear. In this new window, paste the code for the macro. Make sure to paste this code underneath the last line of any other code which is already in the window.

Go to Step 8.

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

Within the list that appears you will see every worksheet that is in that excel file. They will be listed as such: Sheet1(NAME OF SHEET HERE) and under that will be Sheet2(NAME OF SHEET HERE). Select the sheet in which you want the macro to run and double-click that sheet.

A new window inside the Visual Basic Editor's window will appear. In this new window, paste the code for the macro. Make sure to paste this code underneath the last line of any other code which is already in the window.

Repeat steps b and c for every sheet you want the macro to work in. Putting the macro in one sheet will not enable it for any other sheets in the workbook.

Go to Step 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.

When adding a comment I check for an existing comment, if exist then delete and add new comment and some text in that cell.
This works as long as the cell has an existing comment; other wise it advances to the "Else" where I thought I would be entering a comment and text in an empty cell.
Why does my macro treat an empty cell as if it has a comment?
Code:

I am looking for a code that will take comments from multiple cells within a row and return the product into one cell in a difrrent worksheet. I have tried everything with no luck. Can someone please help me out?

How can I modify this sub to skip cells that are empty? I only want cells that are populated within the range to actually display the comment indicator, with the cell text transferred to the comment.

Ideally, I'd also like the text to be moved (not just copied) to the comment and leave an 'X' in the cell, in place of the text that was transferred to the comment, but I'll settle for the action above.

I am having trouble writing a macro to do the following. Someone had created a spreadsheet a while back that highlighted the cell green and inserted a comment with the person's name and date/time if they changed anything in that cell. The macro works great, but I need a macro to undo the changes.

I would like a macro that will remove all comments from the sheet and revert the cells back to their original color. Since the cells encompass many colors, at the very least, I would like the macro to remove the comments and make the cells the default shading (white).

I am having trouble writing a macro to do the following. Someone had created a spreadsheet a while back that highlighted the cell green and inserted a comment with the person's name and date/time if they changed anything in that cell. The macro works great, but I need a macro to undo the changes.

I would like a macro that will remove all comments from the sheet and revert the cells back to their original color. Since the cells encompass many colors, at the very least, I would like the macro to remove the comments and make the cells the default shading (white).

Hi all,
Im new to this so please bare with me :P !! i have only started using macros recently so not good at it at all. here is the story i have around 30 something worksheets all with the same format and i am interested in 2 columns from each worksheet. one column contains numbers of observations for different headings and the other column contains a description of each observation.

what i am trying to do is copy the number column from each of my 30ish worksheets and plot them into one summary sheet beside each other which i have managed to do as shown in the code below, the second thing i want to do is insert my observation column as a comment for each of the corresponding cells in the summary sheet. i have being trying to do it but no luck . if any one can lead me in the right path or maybe come up with a better alternative that would be very helpful thanks.

I have this simple macro that enters a formula in a given range. Works great, but after it's all said and done, the cells contain the green comment like thing in the upper left corners. It basically says that "Formulas Omit Adjacent Cells." I know what it means but is there a way to eliminate all these comments in the same range within the same macro? I tried using the recorder but it didn't work.

Can you help me by editing this code so that every instance of the username
is in bold whether it is a new comment or an add to comment? I would prefer
just the username be in bold but the username,hour,time line being all bold
as it is now is acceptable. I tried just about everything I can think of so
far so HELP!