跳到主要内容

如何在Excel中使用快捷方式返回上一张/最后一张纸?

假设当前工作簿中有几十个工作表,并且您想返回到上一个或最后一个表以复制内容或用于其他目的。 但是现在工作表名称在“工作表”栏中变得很拥挤,而且很难一眼就找到前一个工作表。 那么,如何使用快捷键立即返回上一页/最后一页? 这里有两个技巧:


使用VBA返回上一页/最后一页

以下VBA代码使您可以在当前工作簿中的上次使用的工作表和当前工作表之间切换。 您可以执行以下操作:

1。 按 其他 + F11 键以打开“ Microsoft Visual Basic应用程序”窗口。

2。 双击 的ThisWorkbook 在左栏中,然后将以下代码粘贴到打开的窗口中:

VBA 1:返回上一页/最后一页

Private Sub Workbook_SheetDeactivate(ByVal Sh As Object)
LastSheet = Sh.Name
End Sub

3。 继续选择左侧栏中的ThisWorkbook,然后单击 插页 > 模块,然后将以下代码粘贴到打开的“模块”窗口中:

VBA 2:返回上一页/最后一页

Public LastSheet As String
Sub Select_Last()
Application.Sheets(LastSheet).Select
End Sub

你可以按 F5 键或单击 运行 按钮立即返回到上一次使用的工作表。

如果您希望使用快捷方式在当前工作表和上次使用的工作表之间进行切换,请继续:

4。 点击 开发商 > 打开宏对话框。

备注:默认情况下,“开发人员”选项卡不显示在功能区中,单击以了解 如何在Excel功能区中显示/显示开发人员选项卡.

5。 在打开的宏对话框中,单击以突出显示以下宏: 选择最后,然后单击 附加选项 按钮。

6。 在 快捷键 部分,指定运行此宏的快捷方式 选择最后,然后点击 OK 按钮关闭对话框。

7。 关闭宏对话框。

从现在开始,当您连续打开多个工作表时,可以按指定的快捷键(在本例中,请按 按Ctrl + b)可在当前工作表和上一页/上一页之间切换。


使用 Kutools for Excel 快捷方式返回到上一张/最后一张工作表

如果您已经安装了 Kutools for Excel,您可以应用它 在上一张和当前表格之间切换 实用程序可轻松在Excel中返回到最后一张工作表。

Kutools for Excel - 包含 300 多个 Excel 基本工具。 享受全功能 30 天免费试用,无需信用卡! 现在下载!

只需点击  导航窗格中的按钮或按 Win + A 同时按键可在当前工作表和上一个/上一个之间切换。

备注:安装 Kutools for Excel 后,导航窗格默认打开。如果您找不到导航窗格或  导航窗格中的按钮,您可以单击 库工具 > 旅游导航 (或 查看 > 旅游导航 )以激活导航窗格,然后单击  导航窗格最左侧的按钮。

Kutools for Excel - 使用 300 多种基本工具增强 Excel 功能。 享受全功能 30 天免费试用,无需信用卡! 立即行动吧!


演示:一键返回上一页/最后一页


Kutools for Excel:超过 300 个方便的工具触手可及! 立即开始 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 (8)
No ratings yet. Be the first to rate!
This comment was minimized by the moderator on the site
First code in a while that doesn't work..
This comment was minimized by the moderator on the site
Good morning sir/madam,Is there any option for change tab automatically after adding some no.s in excel without using keyboard.
This comment was minimized by the moderator on the site
I use ctrl+{ to open the referenced formula cell which is another sheet..i want to go back to the last sheet directly (which is few sheet away from the current sheet) instead of using ctrl+pg up/down..thanks in advance.
This comment was minimized by the moderator on the site
Hi Geebu,
In the first method of this article, you can customize the hotkeys as you need in the step 7. On the other hand, Kutools for Excel’s Navigation Pane is an easy and handy tools to return to last used sheet.
This comment was minimized by the moderator on the site
in this section "Go back to previous/last sheet with VBA" .How can i change the shortcut key to a command button? is there any way?
This comment was minimized by the moderator on the site
Hi Muhammad,
You can assign the VBA for a button in the Quick Access Toolbar.
1. Follow step 1-3 in the first method to add both VBA.
2. Click File > Options > Quick Access Toolbar, select Macros from Choose commands from drop-down list, select the specified macro and add it to the right section. Below screenshot may help you understand it faster.

3. Return to the Excel window, a button assigned to the specified macro is added in the Quick Access Tools.
This comment was minimized by the moderator on the site
This tutorial is helpful, but in the section where it's showing you how to create a macro, I keep getting an error that says "Subscript out of range" in the third line. Do you know what's wrong with this script?
This comment was minimized by the moderator on the site
I keep getting the same error, I would love for this to work!
There are no comments posted here yet
Please leave your comments in English
Posting as Guest
×
Rate this post:
0   Characters
Suggested Locations