Please Note: This article is written for users of the following Microsoft Excel versions: 2007, 2010, 2013, 2016, 2019, Excel in Microsoft 365, and 2021. If you are using an earlier version (Excel 2003 or earlier), this tip may not work for you. For a version of this tip written specifically for earlier versions of Excel, click here: Adding a Comment to Multiple Cells.
Written by Allen Wyatt (last updated June 8, 2021)
This tip applies to Excel 2007, 2010, 2013, 2016, 2019, Excel in Microsoft 365, and 2021
Keith notes that adding a comment to a cell is easy. He wonders if there is a way to insert the same comment into multiple cells at the same time.
The short answer is that there is no way to insert multiple comments at the same time. You can, however, copy a comment to multiple cells. Follow these steps:
Figure 1. The Paste Special dialog box.
The result is that only the comment from the cell in step 2 is pasted to the cells you selected in step 3. If any of those cells already had comments, those comments are replaced with the one you are pasting.
If you really want to add the comment to all the cells at the same time, then the only way to do it is through a macro. The following example will prompt you for a comment and then add the comment to all the cells you've selected.
Sub InsertCommentsSelection() Dim sCmt As String Dim rCell As Range sCmt = InputBox( _ Prompt:="Enter Comment to Add" & vbCrLf & _ "Comment will be added to all cells in Selection", _ Title:="Comment to Add") If sCmt = "" Then MsgBox "No comment added" Else For Each rCell In Selection With rCell .ClearComments .AddComment .Comment.Text Text:=sCmt End With Next End If Set rCell = Nothing End Sub
Note:
ExcelTips is your source for cost-effective Microsoft Excel training. This tip (11499) applies to Microsoft Excel 2007, 2010, 2013, 2016, 2019, Excel in Microsoft 365, and 2021. You can find a version of this tip for the older menu interface of Excel here: Adding a Comment to Multiple Cells.
Create Custom Apps with VBA! Discover how to extend the capabilities of Office 2013 (Word, Excel, PowerPoint, Outlook, and Access) with VBA programming, using it for writing macros, automating Office applications, and creating custom applications. Check out Mastering VBA for Office 2013 today!
Comments are a great way to document your worksheets. Excel provides you the tools you need in order to format your ...
Discover MoreComments and notes can be very helpful in a worksheet. After they are added, you may want to change what they contain. ...
Discover MoreNeed to know how many comments are in a worksheet? You can figure out the count manually, or you can apply the handy ...
Discover MoreFREE SERVICE: Get tips like this every week in ExcelTips, a free productivity newsletter. Enter your address and click "Subscribe."
2021-06-08 04:50:08
Rick Rothstein
For your macro, instead of looping through each cell in the selection, why not just implement the code equivalent of the manual steps you outlined above...
Sub InsertCommentsSelection()
Dim sCmt As String
sCmt = InputBox("Enter Comment to Add" & vbCrLf & _
"Comment will be added to all cells in Selection", _
"Comment to Add")
If sCmt = "" Then
MsgBox "No comment added"
Else
Selection(1).AddComment sCmt
Selection(1).Copy
Selection.PasteSpecial xlPasteComments
End If
End Sub
2018-10-06 21:30:00
Kevin K
Thank you
Got a version of Excel that uses the ribbon interface (Excel 2007 or later)? This site is for you! If you use an earlier version of Excel, visit our ExcelTips site focusing on the menu interface.
FREE SERVICE: Get tips like this every week in ExcelTips, a free productivity newsletter. Enter your address and click "Subscribe."
Copyright © 2024 Sharon Parq Associates, Inc.
Comments