
如何在Excel中突出顯示活動工作表標簽?
在打開的工作簿中,活動工作表選項卡通過默認情況下變白并加粗文本來與其他選項卡區分開。 如果要使活動工作表選項卡在工作簿中更加突出,本文中的一種方法可以為您提供幫助。
用VBA代碼突出顯示活動的工作表選項卡
用VBA代碼突出顯示活動的工作表選項卡驚人的! 在 Excel 中使用高效的選項卡,如 Chrome、Firefox 和 Safari!每天節省50%的時間,并減少數千次鼠標單擊!請執行以下操作以突出顯示打開的Excel工作簿中的活動工作表標簽。
1.在工作簿中,要突出顯示活動工作表標簽,請按 其他 + F11 鍵打開 Microsoft Visual Basic應用程序 窗口。
2.在 Microsoft Visual Basic應用程序 窗口,請雙擊 的ThisWorkbook 在左窗格中,然后將VBA代碼復制并粘貼到 本工作簿(代碼) 窗口。 看截圖:
VBA代碼:在打開的工作簿中突出顯示活動的工作表選項卡
Private Sub Workbook_SheetActivate(ByVal Sh As Object)Dim xSheet As WorksheetApplication.ScreenUpdating = FalseFor Each xSheet In ThisWorkbook.WorksheetsIf xSheet.Name = ActiveSheet.Name ThenxSheet.Tab.ColorIndex = 6ElsexSheet.Tab.ColorIndex = 2End IfNextApplication.ScreenUpdating = TrueEnd SubCopy3. Press the Alt + Q keys to close the Microsoft Visual Basic for Applications window.Now, when you activate a sheet, the sheet tab is highlighted in yellow automatically as below screenshot shown:Related Articles:How to reference tab name in cell in Excel?How to make sheet tab name equal to cell value in Excel?How to match the cell value with sheet tab name or vice versa in Excel?Best Office Productivity ToolsTransform 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
