跳到主要內容

如何在Excel中隱藏具有零值的行?

如何在Excel中隱藏零行? 本教程指導您在Excel中隱藏值為零的行。


使用宏隱藏值為零的行

Excel沒有提供直接的方法來隱藏具有零值的行。 對於熟練和專業的用戶,以下代碼必須對您有很大幫助。

步驟1:按 Alt + F11 打開VBA窗口;

步驟2:點擊 模塊 插入 標籤,將代碼放入 模塊 窗口;

步驟3:點擊 按鍵 或按 F5 應用VBA。

VBA代碼隱藏具有零值的行:

Sub HideRowsByZero()
'Update 20131107
Dim Rng As Range
Dim WorkRng As Range
On Error Resume Next
xTitleId = "KutoolsforExcel"
Set WorkRng = Application.Selection
Set WorkRng = Application.InputBox("Range", xTitleId, WorkRng.Address, Type:=8)
For Each Rng In WorkRng
    If Rng.Value = "0" Then
        Rng.EntireRow.Hidden = True
    End If
Next
End Sub

使用Kutools for Excel快速隱藏具有零值的行

第三方外接程序的“選擇特定單元格”實用程序 Excel的Kutools 可以幫助輕鬆選擇包含零值的行。

Excel的Kutools:具有300多個方便的Excel加載項,可以在30天內免費試用,沒有任何限制。 立即獲取

對於大多數計算機用戶來說,運行VBA有點複雜,因此,需要一種更簡單的方法來隱藏零值的行。 選擇 特定細胞 in Excel的Kutools 將是您完成這項工作的好選擇。

安裝後 Excel的Kutools,申請 選擇特定的單元格 根據以下步驟:

步驟1:選擇要隱藏零值行的範圍。

步驟2:點擊 庫工具 > 選擇工具 > 選擇特定的單元格。 看截圖:

步驟3:在彈出對話框中應用設置:

1。 選擇 整行 在選擇類型選項中;

2.將特定類型指定為 等於0,然後點擊 OK。 看截圖:

小提示: 您可以在下面的框中添加其他條件以選擇所需的單元格。

步驟4:已選擇值為零的行,然後您可以 右鍵單擊 選擇的行 隱藏 在菜單中。

以下示例顯示如何通過以下方式選擇零值的行 Excel的Kutools。 看截圖:

提示:

1.要在整個工作表中隱藏值為零的單元格, 請點擊查看更多…

2.要隱藏選定範圍內零值的單元格, 請點擊查看更多…

最佳辦公生產力工具

🤖 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 (7)
Rated 5 out of 5 · 1 ratings
This comment was minimized by the moderator on the site
This is awesome ! thanks
Rated 5 out of 5
This comment was minimized by the moderator on the site
um excuse me plz halp. I have deleted everything
This comment was minimized by the moderator on the site
Hello we are sorry for you
This comment was minimized by the moderator on the site
how can i unhide the rows after i hide it? i used the first method (macros) thanks
This comment was minimized by the moderator on the site
same here. I was able to hide the rows using the vb code, how to I reset and display again??
This comment was minimized by the moderator on the site
Is there any way using this program that I can hide rows that have zero value? I know that Kutools will allow me to see the rows and then I can right click on them and hide. Is there a quicker way to do this using Kutools? As I have multiple sheets and rows it would be nice if there was a one click way to do this. Any help would be appreciated. Thank you, Lynne
This comment was minimized by the moderator on the site
[quote]Is there any way using this program that I can hide rows that have zero value? I know that Kutools will allow me to see the rows and then I can right click on them and hide. Is there a quicker way to do this using Kutools? As I have multiple sheets and rows it would be nice if there was a one click way to do this. Any help would be appreciated. Thank you, LynneBy Lynne[/quote] After selecting rows according to the above section 2, you can right click on the rows and choose to hide them all.
There are no comments posted here yet
Please leave your comments in English
Posting as Guest
×
Rate this post:
0   Characters
Suggested Locations