跳到主要內容

如何使用 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中返回到最後一張工作表。

Excel的Kutools - 包含 300 多個 Excel 基本工具。 享受全功能 30 天免費試用,無需信用卡! 現在下載!

只需點擊  導航窗格中的按鈕或按 Win + A 同時按鍵可在當前工作表和上一個/上一個之間切換。

備註:安裝Kutools for Excel之後,默認情況下,導航窗格會打開。 如果找不到導航窗格,或者  導航窗格中的按鈕,您可以單擊 庫工具 > 導航 瀏覽 > 導航)以激活導航窗格,然後單擊  導航窗格最左側的按鈕。

Excel的Kutools - 使用 300 多種基本工具增強 Excel 功能。 享受全功能 30 天免費試用,無需信用卡! 立即行動吧!


演示:一鍵返回上一頁/最後一頁


Excel的Kutools:超過 300 個方便的工具觸手可及! 立即開始 30 天免費試用,沒有任何功能限制。 現在就下載!

相關文章:

最佳辦公生產力工具

🤖 Kutools 人工智慧助手:基於以下內容徹底改變數據分析: 智慧執行   |  生成代碼  |  建立自訂公式  |  分析數據並產生圖表  |  呼叫 Kutools 函數...
熱門特色: 尋找、突出顯示或識別重複項   |  刪除空白行   |  合併列或儲存格而不遺失數據   |   沒有公式的回合 ...
超級查詢: 多條件VLookup    多值VLookup  |   跨多個工作表的 VLookup   |   模糊查詢 ....
高級下拉列表: 快速建立下拉列表   |  依賴下拉列表   |  多選下拉列表 ....
欄目經理: 新增特定數量的列  |  移動列  |  切換隱藏列的可見性狀態  |  比較範圍和列 ...
特色功能: 網格焦點   |  設計圖   |   大方程式酒吧    工作簿和工作表管理器   |  資源庫 (自動文字)   |  日期選擇器   |  合併工作表   |  加密/解密單元格    按清單發送電子郵件   |  超級濾鏡   |   特殊過濾器 (過濾粗體/斜體/刪除線...)...
前 15 個工具集12 文本 工具 (添加文本, 刪除字符,...)   |   50+ 圖表 類型 (甘特圖,...)   |   40+ 實用 公式 (根據生日計算年齡,...)   |   19 插入 工具 (插入二維碼, 從路徑插入圖片,...)   |   12 轉化 工具 (數字到單詞, 貨幣兌換,...)   |   7 合併與拆分 工具 (高級合併行, 分裂細胞,...)   |   ... 和更多

使用 Kutools for Excel 增強您的 Excel 技能,體驗前所未有的效率。 Kutools for Excel 提供了 300 多種進階功能來提高生產力並節省時間。  點擊此處獲取您最需要的功能...

產品描述


Office選項卡為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