跳到主要内容

如何在Excel的单元格中快速插入工作表名称?

有没有一种简单的方法可以在一个单元格中插入当前工作表的名称? 如何在单元格中插入所有工作表的名称? 本文将为您提供解决这些问题的棘手方法。

使用功能在单元格中快速插入当前工作表名称

使用VBA将所有工作表名称快速插入单元格中

使用 Kutools for Excel 快速插入活动工作表的名称 好主意3

快速将所有带有超链接的工作表名称插入单元格中作为索引 好主意3


箭头蓝色右气泡 使用功能在单元格中快速插入当前工作表名称

只需输入公式 = RIGHT(CELL(“ filename”,D2),LEN(CELL(“ filename”,D2))-FIND(“]”,CELL(“ filename”,D2)))) 在任何单元格中,然后按 输入 键,它在单元格中显示当前工作表的名称。
doc-insert-sheets-name-to-to-cells1

此公式只能显示当前工作表的名称,而不能显示其他工作表的名称。


箭头蓝色右气泡 使用VBA将所有工作表名称快速插入单元格中

如果要插入单元格中的所有工作表名称,则VBA宏是一个不错的选择。

步骤1:按住 其他 + F11 键,然后打开 Microsoft Visual Basic应用程序 窗口。

步骤2:点击 插页 > 模块,然后将以下宏粘贴到“模块窗口”中。

VBA用于在单元格中插入所有工作表的名称:

子SheetNames()
列(1)。插入
对于i = 1 To Sheets.Count
单元格(i,1)=图纸(i)。名称
接下来,我
END SUB

步骤3:按下 F5 运行此宏的键。 然后,您将在当前工作表的A列中列出所有工作表的名称。 看截图:
doc-insert-sheets-name-to-to-cells2

备注:在VBA代码中,您可以更改 单元格(i,1) 其他参考以插入工作表名称从其他单元格开始。 例如,插入工作表名称从C3开始,将其更改为 单元格(i + 2,3).


箭头蓝色右气泡 使用 Kutools for Excel 快速插入活动工作表的名称

如果要将活动工作表的信息(包括工作表名称,工作簿名称,文件路径等)插入到单元格或页眉/页脚中,则可以使用 Kutools for Excel插入工作簿信息.

Kutools for Excel, 与超过 300 方便的功能,使您的工作更加轻松。 

免费安装 Kutools for Excel,请执行以下操作:

1.选择一个单元格或范围以放置工作表名称,然后单击 Kutools 加 > 工作簿 > 插入工作簿信息.doc插入工作表信息1

2.然后选择您需要从中插入的工作簿信息 资讯 部分,并指定要从中放置信息的位置 插入于 部分。 然后点击 OK.

doc 1

您可以单击此处以了解有关插入工作簿信息的更多信息。

箭头蓝色右气泡 将工作簿信息插入单元格/页眉/页脚


箭头蓝色右气泡 快速将所有带有超链接的工作表名称插入单元格中作为索引

Kutools for Excel's 创建工作表名称列表 实用程序不仅将所有工作表名称插入到单元格中,而且还插入指向相应工作表的超链接。

Kutools for Excel, 与超过 300 方便的功能,使您的工作更加轻松。 

免费安装 Kutools for Excel,请执行以下操作:

步骤1:点击 Kutools 加 > 工作表 > 创建工作表名称列表。
doc-insert-sheets-name-to-to-cells3

步骤2: 创建工作表名称列表 对话框,根据需要指定设置,然后单击 OK.
doc-insert-sheets-name-to-to-cells4

然后,您将看到所有工作表名称都插入到新的工作表中,并且每个工作表名称都链接到相应的工作表。 请参阅以下屏幕截图:

带超链接的工作表名称
带宏按钮的工作表名称
doc-insert-sheets-name-to-to-cells5
doc-insert-sheets-name-to-to-cells6

创建工作表名称列表 实用程序使您可以轻松地在新工作表中创建活动工作簿的所有工作表名称的列表,其中包含用于快速导航至其他工作表的超链接或宏按钮。 单击以了解有关此实用程序的更多信息。

箭头蓝色右气泡 列出所有带有超链接的工作表名称



Kutools for Excel:300 + Excel 中必须具备的功能, 从这里免费试用30天

轻松地将多个工作表/工作簿合并为一个工作表或工作簿

在Excel中,将多个工作表或工作簿组合成一个工作表或工作簿可能很麻烦,但是使用 结合 Kutools for Excel 中的功能,您可以将数十个工作表/工作簿合并为一张工作表或工作簿,也可以通过几次点击将工作表合并为一张。  点击获取全功能 30 天免费试用!
合并表
 
Kutools for Excel:拥有300多个便捷的Excel加载项,可以在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 (32)
No ratings yet. Be the first to rate!
This comment was minimized by the moderator on the site
how to find the sheet name (section name ) when you type employee no. in a cell? A workbook has 15 sheets named as per sections of the department.In each section has 100 employees in range A2:A101with unique employee no. I have a list of 50 employee nos in different sections. In a new work sheet how to find the section name which corresponds to the employee no.
This comment was minimized by the moderator on the site
Hello, Ashley Pereira, please visit this: https://www.extendoffice.com/documents/excel/5335-excel-vlookup-return-sheet-name.html this article may help you.
This comment was minimized by the moderator on the site
How do you get this formula to copy the tabnames into consecutive columns. In other words not vertically but horizontally.
This comment was minimized by the moderator on the site
Change the following:

Cells(i, 1) = Sheets(i).Name
to
Cells(1, i) = Sheets(i).Name

This causes to step columns in same row.
This comment was minimized by the moderator on the site
you can copy the data entered, then paste Transpose, this converts Cols to Rows, and Rows to Cols.
This comment was minimized by the moderator on the site
Just tried now the macro for inserting all the sheet's name in one sheet. Awesome! Thank you very much
This comment was minimized by the moderator on the site
How do you get the VBA to start in a specific cell instead of A1?
This comment was minimized by the moderator on the site
Just add to i like I did below. If you add to i you can start on any row you would like.

Sub GetNames()

For i = 1 To Sheets.Count

Cells(i + 6, 1) = Sheets(i).Name

Next i
End Sub
This comment was minimized by the moderator on the site
Thank u for your supplement.
This comment was minimized by the moderator on the site
You can change the number in Cells(i, 1) = Sheets(i).Name to other to insert the sheet names in other column, for instance, insert start from C1,change Cells(i, 1) = Sheets(i) to Cells(i, 3) = Sheets(i), but this VBA only can insert the sheet names start from the row 1.
This comment was minimized by the moderator on the site
Thanks!! this was was a great help.
This comment was minimized by the moderator on the site
Hi Kindly i want VBA code to insert file name in specific cell. Thanks
This comment was minimized by the moderator on the site
Great site was very helpful. I have different tab names and I get the names in one sheet using your code, but it gives names of all the tab names, is there anyway we can add code to select from certain tab number or something like that.
This comment was minimized by the moderator on the site
I have multiple project sheets database with different tab name and this name is shown in master sheet table. which formula can i give that when i insert new tab it should automatically updated in master table.
This comment was minimized by the moderator on the site
Can anyone help me with this: Create a macro that creates 10 sheets and name them Sheet1 to Sheet10 but using a loop
This comment was minimized by the moderator on the site
Hello, Can you please help me with the simple VBA code. I have a list of Names in Column A. Specific Range - (A2:A251) - Now I need to create new spreadsheets with these names. The names are driven from a different sheet, thus they keep changing. So in short, if I have 10 names today, they might not appear tomorrow. So on the click of button all older spreadsheets (except 1) should be deleted first and then from the names on the column, new ones should get created. Please advice if this is possible to do? Thanks, Manish Gupta
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