跳到主要内容

如何在Excel中获取并插入最后修改的用户名?

本文将向您展示获取上次修改的用户名信息并将上次修改的用户名信息插入Excel单元格的方法。

获取Excel中当前工作簿的最后修改的用户名
使用用户定义的功能插入当前工作簿的最后修改的用户名
使用 Kutools for Excel 轻松在单元格、页眉或页脚中插入用户名


获取Excel中当前工作簿的最后修改的用户名

众所周知,我们可以在当前工作簿的“高级属性”对话框中获取上次修改的用户名信息。

如果您使用的是Excel 2007

您可以通过以下步骤获取上次在Excel中修改当前工作簿的用户名:

步骤1:点击 办公按钮 >> Prepare >> 查看房源.

步骤2:然后将文档窗格添加到工作表上方。 点击 文档属性 >> 先进的属性.

步骤3:在弹出的“高级属性”对话框中,您将看到 最后保存者: 信息下 统计报表 标签。

如果您使用的是Excel 2010、2013或更高版本

如果您使用的是Microsoft Excel 2010或更高版本,则可以通过以下步骤获取最后修改的用户信息:

只需点击 文件 > 信息,您将获得 最后修改者 右侧下方的信息 相关人员 部分。 请参阅以下屏幕截图。


使用用户定义的函数插入上次修改当前工作簿的用户名

1:按住 ALT + F11 键打开 Microsoft Visual Basic应用程序 窗口。

2: 在里面 Microsoft Visual Basic应用程序 窗口中,单击 插页 > 模块,然后将以下宏粘贴到“模块窗口”中。 见截图L

VBA代码:在Excel中插入最后修改的用户名

Function LastAuthor()
LastAuthor = ActiveWorkbook.BuiltinDocumentProperties("Last Author")
End Function

3: 按 其他 + Q 关闭键 Microsoft Visual Basic应用程序 窗口。

4。 选择一个需要放置用户名的单元格,输入公式 = LastAuthor() 进入编辑栏,然后按 输入 键。 然后,最后修改的用户名立即插入到单元格中。 看截图:


使用 Kutools for Excel 轻松在单元格、页眉或页脚中插入用户名

您可以轻松地在Excel中的指定单元格,工作表页眉或页脚中插入用户名。 插入工作簿信息 实用程序 Kutools for Excel。 请执行以下操作。

申请前 Kutools for Excel首先下载并安装.

1。 点击 Kutools 加 > 工作簿 > 插入工作簿信息。 看截图:

2.在 插入工作簿信息 对话框,您需要:

1)。 选择 用户名 在选项 资讯 部分。

2)。 如果要将用户名插入指定的单元格,请在 范围 框; 要将用户名插入页眉或页脚,请选择 标题 or 页脚 选项。

3)。 点击 Ok 按钮。 看截图:

然后,用户名将立即插入到指定位置。

  如果您想免费试用(30天)此实用程序, 请点击下载,然后按照上述步骤进行操作。

最佳办公生产力工具

🤖 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 (16)
No ratings yet. Be the first to rate!
This comment was minimized by the moderator on the site
How can the Activeworkbook be dynamic?

I tried to no success the below code

LastSavedby = Range("A1").value.BuiltinDocumentProperties("Last Author")

Where in A1 contains the path of the file with the file name and extension
This comment was minimized by the moderator on the site
Hi! I, my case it doesn't work automatically, I need to press "enter" after the formula "= VBAProject.Module3.LastAuthor()".
How should i make it automatic?
Thank you
This comment was minimized by the moderator on the site
Hey, this code worked nicely. Is there a way I can display the user name if a ROW is adjusted? For example, I hhave Column K with the header "Last modified By", and I want to know who adjusted "each row" as this is a shared document. I have the below code for Date, which works like how I would want the name to work: Private Sub Worksheet_Change(ByVal Target As Range) If Target.Column > 11 Or Target.Row = 1 Then Exit Sub Application.EnableEvents = False Cells(Target.Row, 12) = Now Application.EnableEvents = True End Sub Please email me if possible
This comment was minimized by the moderator on the site
Hi. I would like to ask how to write the VBA codes to retrieve all current users which modifying on the worksheet. Thank You:)
This comment was minimized by the moderator on the site
thanks a lot for this helpful article. I used it and it worked well. can I get the last modified date on that sheet just like the username ? MANY THANKS
This comment was minimized by the moderator on the site
Can u pls help if iwant the user name to appear in aspreadsheet as and when the previous cell is filled by a user
This comment was minimized by the moderator on the site
Thanks, Cp & Jay Chivo :)
This comment was minimized by the moderator on the site
Sub UserName() Sheets("Sheet1").Range("A1").Value = Environ("username") End Sub --------------- Change the sheet name
This comment was minimized by the moderator on the site
I am runing excel 2007 and am getting the runtime error 9, script out of range as well. any way to make it work in excel 2007?
This comment was minimized by the moderator on the site
Excel 2010. Same time i would like to ask that is it possible to use this Subscript with another function script ? Thanks Naghman
This comment was minimized by the moderator on the site
[quote]Excel 2010. Same time i would like to ask that is it possible to use this Subscript with another function script ? Thanks NaghmanBy Naghman[/quote] With another script? What script? :-)
This comment was minimized by the moderator on the site
To get last saved date. Function LastSaveDate() Application.Volatile True LastSaveDate = FileDateTime(ThisWorkbook.FullName) End Function
There are no comments posted here yet
Load More
Please leave your comments in English
Posting as Guest
×
Rate this post:
0   Characters
Suggested Locations