Written by Allen Wyatt (last updated February 10, 2022)
This tip applies to Excel 2007, 2010, 2013, and 2016
Grant has a cell in a worksheet that when someone starts typing in the cell, he would like whatever they type to end up in a comment attached to the cell. The cell itself should remain blank, but the comment should contain whatever was typed.
The only way to accomplish this task is through the use of a macro. Using the event handler capabilities of Excel, you can create a macro that is triggered whenever a cell is changed. If the changed cell happens to be the cell that you want the comment associated with, then you can transfer the cell contents to the comment and remove them from the cell itself. The following short macro will do that:
Private Sub Worksheet_Change(ByVal Target As Range)
Dim rCell As Range
Dim sTemp As String
Set rCell = Range("B4")
If Not Intersect(Target, rCell) Is Nothing Then
sTemp = rCell.Value
rCell.ClearComments
If Len(sTemp) > 0 Then
Application.EnableEvents = False
On Error Resume Next
rCell.AddComment
rCell.Comment.Text Text:=sTemp
On Error GoTo 0
rCell.ClearContents
Application.EnableEvents = True
End If
End If
End Sub
Note that since this is an event handler, it needs to be added to the code module for the worksheet you want affected. In this case, the move-to-comment code is triggered only when a change is made in cell B4; this address can be changed in the code, if desired.
It should also be noted that this macro is only triggered once the user finishes entering something into cell B4. It isn't triggered as the user starts to type. So, actual data entry still occurs in cell B4, not in the comment itself. Further, if someone types something into cell B4, then any existing comment is lost because the macro deletes it before moving the cell contents into the comment.
ExcelTips is your source for cost-effective Microsoft Excel training. This tip (13511) applies to Microsoft Excel 2007, 2010, 2013, and 2016.
Best-Selling VBA Tutorial for Beginners Take your Excel knowledge to the next level. With a little background in VBA programming, you can go well beyond basic spreadsheets and functions. Use macros to reduce errors, save time, and integrate with other Microsoft applications. Fully updated for the latest version of Office 365. Check out Microsoft 365 Excel VBA Programming For Dummies today!
Want to make your worksheet comments appear a certain way? It's easy to do using techniques you are already familiar with.
Discover MoreComments are a great way to document your worksheets. Excel provides you the tools you need in order to format your ...
Discover MoreWhen you add a comment to a worksheet, Excel uses a default font and size for the text. If you want to make changes to ...
Discover MoreFREE SERVICE: Get tips like this every week in ExcelTips, a free productivity newsletter. Enter your address and click "Subscribe."
There are currently no comments for this tip. (Be the first to leave your comment—just use the simple form above!)
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 © 2025 Sharon Parq Associates, Inc.
Comments