跳到主要內容

如何計算工作簿的張數?

您是否考慮過如何計算工作簿中工作表的數量? 如果有很多工作表,一個接一個地計算它們是一件無聊的工作。 實際上,沒有直接的公式來計算工作表的數量。 但是,在這裡,我可以向您介紹一些有用且方便的技巧來解決此問題。

計算工作簿 SHEETS 函數中的工作表數

使用“定義名稱”命令計算工作簿中的工作表數

用VBA代碼計算工作簿中的工作表數

通過導航窗格顯示工作簿中的工作表數 好主意3

通過創建工作表列表來計算工作簿中的工作表數 好主意3


箭頭藍色右氣泡計算工作簿 SHEETS 函數中的工作表數

如果您的 Excel 版本是 2013 或更高版本,您可以使用 SHEETS 函數獲取當前工作簿的總工作表數。

選擇一個空白單元格,然後鍵入 =床單() 進入其中,按 Enter 鍵獲取張數。


箭頭藍色右氣泡使用“定義名稱”命令計算工作簿中的工作表數

在Excel中,您可以先將公式應用於“定義名稱”功能,然後計算工作表的數量。

1。 啟動您要計算工作表數量的工作簿。

2。 點擊 公式 > 定義名稱,請參見屏幕截圖:

doc-count-of-sheets1

3。 而在中 新名字 對話框中,在 姓名 文本框,然後輸入此公式 = GET.WORKBOOK(1)&T(NOW()) 文本框,請參見屏幕截圖:

doc-count-of-sheets1

4。 然後點擊 OK 關閉此對話框,並返回到工作表,然後鍵入此公式 = COUNTA(INDEX(CountSheets,0))(計數表 該公式中是您在第3步中定義的名稱,您可以根據需要將其更改。)進入空白單元格,請參見屏幕截圖:

doc-count-of-sheets1

5。 然後按 Enter 鍵,您將獲得當前工作簿中的工作表編號。

doc-count-of-sheets1


箭頭藍色右氣泡用VBA代碼計算工作簿中的工作表數

如果您認為上述公式有些難以記住,那麼這裡有一個簡單的VBA代碼也可以為您提供幫助。

1。 按住 ALT + F11 鍵,然後打開 Microsoft Visual Basic for Applications窗口.

2。 點擊 插入 > 模塊,然後將以下代碼粘貼到 模塊窗口.

VBA代碼:計算工作簿中的工作表數

Public Sub CountWorkSheets()
'Update 20140326
MsgBox "The total number sheets of this workbook: " & Application.Sheets.Count
End Sub

3。 然後按 F5 鍵執行此代碼,然後會彈出一個提示框,告訴您工作表的總數,如以下屏幕截圖所示:

doc-count-of-sheets1


箭頭藍色右氣泡 通過導航窗格顯示工作簿中的工作表數

如果你有 Excel的Kutools 安裝後,您顯然可以使用 導航 窗格。

Excel的Kutools, 與以上 300 方便的功能,使您的工作更加輕鬆。 

免費安裝 Kutools for Excel,請執行以下操作:

1。 點擊 庫工具 > 導航 使之成為可能 導航窗格 在工作表的左側。 看截圖:
文檔導航1

2。 然後點擊 工作簿和工作表 標籤,然後您可以查看窗格底部顯示的活動工作簿中的工作表總數,也可以查看工作簿的可見和隱藏工作表數。 看截圖:
文檔導航2

這款獨特的敏感免洗唇膜採用 Moisture WrapTM 技術和 Berry Mix ComplexTM 成分, 導航 窗格中,您可以在工作表之間切換,顯示所有列標題,範圍名稱以及添加自動文本等。 單擊此處了解更多詳細信息。

箭頭藍色右氣泡 導航窗格-列出併計算所有圖紙


箭頭藍色右氣泡 通過創建工作表列表來計算工作簿中的工作表數

如果您認為上述方法不方便,我可以為您介紹一個解決方法。

如果你已經安裝 Excel的Kutools,您可以創建所有工作表的名稱列表,然後選擇它們以在狀態欄中進行計數。

免費安裝 Kutools for Excel,請執行以下操作:

1.啟用要計數其工作表的工作簿,然後單擊 Kutools 加 > 下載學習單 > 創建工作表名稱列表。 看截圖:
文檔導航1

2.然後在彈出的對話框中,檢查 包含超鏈接列表 選項,並且為了方便地選擇工作表名稱,您可以在3列或4列中顯示工作表索引。 看截圖:
文檔計數表2

3。 點擊 Ok,然後會創建一個工作表,其中所有工作表的名稱都在所有工作表之前,而您只需要選擇這些工作表名稱,然後在 狀態欄r.
doc kutools創建工作表名稱列表3

實際上,這些工作表名稱是可鏈接的,您可以單擊一個工作表名稱,然後快速鏈接到相對工作表。 與 創建工作表名稱列表,您可以通過選中來創建工作表名稱的可鏈接按鈕 包含按鈕和宏 選項 。 單擊此處以了解有關創建圖紙名稱列表的更多信息。

箭頭藍色右氣泡 創建圖紙名稱列表



Kutools for Excel:您必須在Excel中擁有300多種功能, 從這裡免費試用30天

好導航窗格-查找和替換

Excel的Kutools的進階 查找和替換 功能,可以幫助您找到並
在多個工作表和工作簿中替換一個值。
doc查找並替換

最佳辦公生產力工具

🤖 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 (16)
Rated 5 out of 5 · 1 ratings
This comment was minimized by the moderator on the site
Thanks!
=Sheets() worked just fine!
Before I thought I must use VBA.
Saved a lot of trouble!
Rated 5 out of 5
This comment was minimized by the moderator on the site
Save the entire workbook in single pdf then u can find easily count the total no of pages.
This comment was minimized by the moderator on the site
I upgraded to Office 365 and now=COUNTA(INDEX(CountSheets,0)) always returns 1. Is there a fix for Excel 365 to get this to work?Thanks,
Jim...
This comment was minimized by the moderator on the site
=SHEETS() in Excel 365 returns 0.
=SHEETS(reference) - so what goes in "reference"?
This comment was minimized by the moderator on the site
Hi, gerland, in my office 365, the defined name method work as well. You can try the SHEETS function, I have updated it as the first one method in this tutorial.
This comment was minimized by the moderator on the site
=Sheets()  gives the answer. 
This comment was minimized by the moderator on the site
=sheets() works great
This comment was minimized by the moderator on the site
It Works only 2010 & Higher Version of Excel. Not Working In Excel 2007
This comment was minimized by the moderator on the site
Tried it on my 2007 version.
=COUNTA(countsheets)
works for me.
This comment was minimized by the moderator on the site
I like it. Thanks too much
This comment was minimized by the moderator on the site
Thank you so much for posting these directions!! I have a workbook with over 700 sheets and never knew there was a way for excel to count them for me. I used the first method and it worked absolutely perfectly!!
This comment was minimized by the moderator on the site
Great! Saved so much of my time!!
This comment was minimized by the moderator on the site
Hi, Thanks! This worked for me great in excel 2013 to count the number of sheets. Crazy that a formula is required to do this.
This comment was minimized by the moderator on the site
Sorry Freddy. Your first method using Formula > Define Name doesn't work. You got a typo somewhere or something
This comment was minimized by the moderator on the site
[quote]Sorry Freddy. Your first method using Formula > Define Name doesn't work. You got a typo somewhere or somethingBy smith[/quote] yes, instead of =COUNTA(INDEX(CountSheets,0)) You should write =COUNTA(INDEX(CountSheets;0))
There are no comments posted here yet
Load More
Please leave your comments in English
Posting as Guest
×
Rate this post:
0   Characters
Suggested Locations