如何在Excel中計算具有特定名稱的工作表?
如何在Excel中計算具有特定名稱的工作表?
您是否曾經(jīng)嘗試過計算以名字開頭或包含特定單詞的工作表的數(shù)量? 例如,計算名稱以“ KTE”開頭或包含“ KTE”的工作表的數(shù)量。 本文將提供幫助您顯示問題的方法。
快速查找工作表名稱中包含特定單詞的所有工作表 使用VBA代碼對具有特定名稱的工作表進行計數(shù)以下VBA代碼可幫助您計算工作簿中具有特定名稱的工作表的數(shù)量。 請執(zhí)行以下操作。
驚人的! 在 Excel 中使用高效的選項卡,如 Chrome、Firefox 和 Safari!
每天節(jié)省50%的時間,并減少數(shù)千次鼠標單擊!
1。 按 其他 + F11 鍵打開 Microsoft Visual Basic應(yīng)用程序 窗口。
2.在 Microsoft Visual Basic應(yīng)用程序 窗口中,單擊 插頁 > 模塊,然后將以下VBA代碼復制到“代碼”窗口中。
VBA代碼1:計算名稱以“ KTE”開頭的工作表
Sub CountWSNames()
Dim I As Long
Dim xCount As Integer
For I = 1 To ActiveWorkbook.Sheets.Count
If Mid(Sheets(I).Name, 1, 3) = "KTE" Then xCount = xCount + 1
Next
MsgBox "There are " & CStr(xCount) & " sheets that start with KTE", vbOKOnly, "KuTools for Excel"
End Sub
If you want to count number of worksheets contain “KTE”, please apply below VBA code 2.
VBA code 2: Count worksheets whose name contain “KTE”
Sub CountWSNames()
Dim I As Long
Dim xCount As Integer
For I = 1 To ActiveWorkbook.Sheets.Count
If InStr(1, Sheets(I).Name, "KTE") > 0 Then xCount = xCount + 1
Next
MsgBox "There are " & CStr(xCount) & " sheets that with KTE", vbOKOnly, "KuTools for Excel"
End Sub
Note: Please replace the Word “KTE” with the one you need count number of worksheets based on.
3. Press the F5 key to run the code. Then a dialog box will pop up to tell you how many worksheets in current workbook start with “KTE” or contain “KTE”. See screenshots:
Number of worksheets whose name start with “KTE”:
Number of worksheets whose name contain “KTE”:
Quickly find all worksheets that contain specific Word in sheet name.
This section will show you how to quickly find all worksheets that contain specific word in sheet name with Kutools for Excel.
Kutools for Excel : with more than 300 handy Excel add-ins, free to try with no limitation in 30 days.
1. After installing Kutools for Excel, the Kutools’ Navigation pane will be opened automatically on the left side of workbook. Or you can enable the pane by clicking Kutools > Navigation as below screenshot shown.
2. In the Workbook & Sheet section of the navigation pane, check the Filter box and enter the specific worksheet name you with find worksheets based on. Then all worksheets whose name contain the specific word are filtered and listed in the worksheet list box. See screenshot:
If you want to have a free trial (30-day) of this utility, please click to download it, and then go to apply the operation according above steps.
Related articles:
How to reference tab name in cell in Excel?
How to match the cell value with sheet tab name or vice versa in Excel?
How to open a specific worksheet by the selected value of a Combo Box in Excel?
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
版權(quán)聲明:本文內(nèi)容由網(wǎng)絡(luò)用戶投稿,版權(quán)歸原作者所有,本站不擁有其著作權(quán),亦不承擔相應(yīng)法律責任。如果您發(fā)現(xiàn)本站中有涉嫌抄襲或描述失實的內(nèi)容,請聯(lián)系我們jiasou666@gmail.com 處理,核實后本網(wǎng)站將在24小時內(nèi)刪除侵權(quán)內(nèi)容。
版權(quán)聲明:本文內(nèi)容由網(wǎng)絡(luò)用戶投稿,版權(quán)歸原作者所有,本站不擁有其著作權(quán),亦不承擔相應(yīng)法律責任。如果您發(fā)現(xiàn)本站中有涉嫌抄襲或描述失實的內(nèi)容,請聯(lián)系我們jiasou666@gmail.com 處理,核實后本網(wǎng)站將在24小時內(nèi)刪除侵權(quán)內(nèi)容。