如何鎖定工作表位置以使其始終在Excel工作簿中可見?
如何鎖定工作表位置以使其始終在Excel工作簿中可見?
如果工作簿中有多個工作表,則切換到最后一個工作表時,第一個工作表將隱藏在工作表選項卡欄中,如下所示。 現在,您希望將母版表的位置鎖定為始終可見,那么如何處理呢?

用VBA鎖定紙張位置
用VBA鎖定紙張位置在這里,我介紹了兩個VBA代碼供您處理這項工作。
跳到工作表
1。 按 Alt + F11鍵 啟用 Windows的Microsoft Visual Basic.
2。 點擊 插頁 > 模塊,然后將以下代碼復制并粘貼到腳本中。
VBA:跳轉到母版表
Sub GoToSheet()
UpdatebyExtendoffice20180427
Sheets("Master").Activate
End Sub
Note: In the code slice of Sheets("Master").Activate, you can change the Master to any sheet name as you need.
3. Then save this code, and go back to the workbook, click Developer > Macros.
4. In the Macro dialog, select the code name you inserted just now, click Options, create a shortcut for running this code.
5. Click OK and close the Macro dialog.
From right now, while you pressing the shortcut you created, the master sheet has been activated whichever sheet you use.
Keep the sheet always in the front
1. Press Alt + F11 keys to enable the Microsoft Visual Basic for Windows.
2. Double click ThisWorkbook from the Project-VBAProject pane, and copy and paste below code to the script.
VBA: Keep sheet always in the front
Private Sub Workbook_SheetActivate(ByVal Sh As Object)
UpdatebyExtendoffice2018027
Dim xSheet As Worksheet
Application.EnableEvents = False
Set xSheet = Sheets("master")
If Sh.Name <> xSheet.Name Then
Sh.Move , xSheet
xSheet.Activate
Sh.Activate
End If
Application.EnableEvents = True
End Sub
3. Save the code and close the VBA window. From now, whichever sheet you click, the master sheet always stay in the front of the tab bar.
Note: In above code, “master” is the sheet name you want to keep visible, change it as you need.
Best Office Productivity Tools
Transform Hours into Minutes with Kutools for Excel!
Ready to supercharge your Excel tasks? Harness the power of Kutools for Excel - your ultimate time-saving tool. Streamline intricate tasks and glide through your data like a pro. Experience Excel at lightning speed!
Why You Need Kutools for Excel
??? Over 300 Powerful Features: Kutools is packed with more than 300 advanced features, simplifying your work in over 1500 scenarios.
?? Superior Data Processing: Merge cells, remove duplicates, and perform advanced data conversions – all without breaking a sweat!
?? Efficient Batch Operations: Why put in extra effort when you can work smart? Import, export, combine, and tweak data in bulk with ease.
?? Customizable Charts and Reports: Access a broad variety of additional charts and generate insightful reports that tell a story.
??? Powerful Navigation Pane: Gain an advantage with the robust Column Manager, Worksheet Manager, and Custom Favorites.
?? Seven Types of Drop-down Lists: Make data entry a breeze with drop-down lists of various features and types.
?? User-Friendly: A breeze for beginners and a powerful tool for experts.
Download Now and Soar Through Time with Excel!
Read More... Free Download... Purchase...
Office Tab Brings Tabbed interface to Office, and Make Your Work Much Easier
Enable tabbed editing and reading in Word, Excel, PowerPoint, Publisher, Access, Visio and Project.
Open and create multiple documents in new tabs of the same window, rather than in new windows.
Increases your productivity by 50%, and reduces hundreds of mouse clicks for you every day!
Read More... Free Download... Purchase...
Copy
版權聲明:本文內容由網絡用戶投稿,版權歸原作者所有,本站不擁有其著作權,亦不承擔相應法律責任。如果您發現本站中有涉嫌抄襲或描述失實的內容,請聯系我們jiasou666@gmail.com 處理,核實后本網站將在24小時內刪除侵權內容。
版權聲明:本文內容由網絡用戶投稿,版權歸原作者所有,本站不擁有其著作權,亦不承擔相應法律責任。如果您發現本站中有涉嫌抄襲或描述失實的內容,請聯系我們jiasou666@gmail.com 處理,核實后本網站將在24小時內刪除侵權內容。