跳到主要内容

如何在Excel中自动添加评论的日期和时间?

当您在单元格中插入注释时,默认情况下将自动插入用户名。 您是否想过是否可以将当前日期和时间也自动添加到评论中? 这将帮助您快速确定创建注释的时间。 本文,我将为您介绍一些技巧,以解决Excel中的此问题。

使用快捷键手动添加日期和时间以进行评论

自动添加日期和时间以使用VBA代码发表评论


箭头蓝色右气泡 使用快捷键手动添加日期和时间以进行评论

无需在注释框中输入数据和时间,您可以使用这些快捷键快速轻松地插入数据和时间。 请执行以下操作:

1。 单击一个要插入带有当前数据和时间的注释的单元格,然后右键单击以选择 插入评论 形成上下文菜单,请参见屏幕截图:

文档添加日期到评论 1

2。 插入评论后,在评论框中,按 CTRL+; 插入当前日期,并键入空格键,然后按 Ctrl + Shift +; 要插入当前时间,并且当前数据和时间已立即添加到注释中,请参见屏幕截图:

文档添加日期到评论 1

3。 然后,您可以根据需要编辑评论。


箭头蓝色右气泡 自动添加日期和时间以使用VBA代码发表评论

如果您不熟悉快捷键,请不用担心,在这里,我可以讨论一个VBA代码来帮助您自动插入日期和时间。

1。 选择要插入注释的单元格。

2。 按住 ALT + F11 键打开 Microsoft Visual Basic for Applications窗口.

3。 点击 插页 > 模块,然后将以下代码粘贴到 模块窗口.

VBA代码:自动添加评论的日期和时间

Sub DatedComment()
'Update 20141110
Dim pComment As Comment
Dim WorkRng As Range
Set WorkRng = Application.ActiveCell
Set pComment = WorkRng.AddComment(Application.UserName & ":" & vbLf & Now & vbLf)
pComment.Shape.TextFrame.Characters(1, VBA.Len(Application.UserName) + 1).Font.Bold = True
End Sub

4。 然后按 F5 键运行此代码,注释将自动插入到具有日期和时间的所选单元格中,并且您可以根据需要编辑注释,请参见屏幕截图:

文档添加日期到评论 1

Tips::如果之前已插入所选单元格,则此VBA无法工作。


相关文章:

如何在Excel中重置所有评论位置?

如何在Excel中用注释突出显示所有单元格?

最佳办公生产力工具

🤖 Kutools 人工智能助手:基于以下内容彻底改变数据分析: 智能执行   |  生成代码  |  创建自定义公式  |  分析数据并生成图表  |  调用 Kutools 函数...
热门特色: 查找、突出显示或识别重复项   |  删除空白行   |  合并列或单元格而不丢失数据   |   不使用公式进行四舍五入 ...
超级查询: 多条件VLookup    多值VLookup  |   跨多个工作表的 VLookup   |   模糊查询 ....
高级下拉列表: 快速创建下拉列表   |  依赖下拉列表   |  多选下拉列表 ....
列管理器: 添加特定数量的列  |  移动列  |  切换隐藏列的可见性状态  |  比较范围和列 ...
特色功能: 网格焦点   |  设计图   |   大方程式酒吧    工作簿和工作表管理器   |  资源库 (自动文本)   |  日期选择器   |  合并工作表   |  加密/解密单元格    按列表发送电子邮件   |  超级筛选   |   特殊过滤器 (过滤粗体/斜体/删除线...)...
前 15 个工具集12 文本 工具 (添加文本, 删除字符,...)   |   50+ 图表 类型 (甘特图,...)   |   40+ 实用 公式 (根据生日计算年龄,...)   |   19 插入 工具 (插入二维码, 从路径插入图片,...)   |   12 转化 工具 (小写金额转大写, 货币兑换,...)   |   7 合并与拆分 工具 (高级组合行, 分裂细胞,...)   |   ... 和更多

使用 Kutools for Excel 增强您的 Excel 技能,体验前所未有的效率。 Kutools for Excel 提供了 300 多种高级功能来提高生产力并节省时间。  单击此处获取您最需要的功能...

产品描述


Office Tab 为 Office 带来选项卡式界面,让您的工作更加轻松

  • 在Word,Excel,PowerPoint中启用选项卡式编辑和阅读,发布者,Access,Visio和Project。
  • 在同一窗口的新选项卡中而不是在新窗口中打开并创建多个文档。
  • 每天将您的工作效率提高50%,并减少数百次鼠标单击!
Comments (6)
No ratings yet. Be the first to rate!
This comment was minimized by the moderator on the site
Love it. Now, I would like to go one step further. When the cell value is changed, I want a comment inserted into the cell with the date/time the cell value changed. if a cell comment already exists, it will be replaced with the new cell comment. This will eliminate a column on my spreadsheet that tracks when an adjacent cell value is updated. Can you help?
This comment was minimized by the moderator on the site
In this video i will show you the present tense with few examples. Quadratic Equation
This comment was minimized by the moderator on the site
In this video I will show you how the angles are formed with different property. angle calculator
This comment was minimized by the moderator on the site
Hey, you used to write amazing, but the last couple of posts have been kinda boring I miss your tremendous writings. Past couple of posts are just a little out of track! come on! bakdfdebffacdefe
This comment was minimized by the moderator on the site
If you work with a Belgian keyboard then Ctrl + does not work. To add the date in your command use Ctrl ; (semi-colon)
This comment was minimized by the moderator on the site
i encounter run time error in line 6-8 line
There are no comments posted here yet
Please leave your comments in English
Posting as Guest
×
Rate this post:
0   Characters
Suggested Locations