跳到主要内容

如何在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 快速隐藏零值行

第三方外接程序的“选择特定单元格”实用程序 Kutools for Excel 可以帮助轻松选择包含零值的行。

Kutools for Excel:具有300多个方便的Excel加载项,可以在30天内免费试用,没有任何限制。 立即获取

对于大多数计算机用户来说,运行VBA有点复杂,因此必须有一种更简单的方法来隐藏零值的行。 选择 特定细胞 in Kutools for Excel 将是您完成这项工作的好选择。

安装后 Kutools for Excel,申请 选择特定的单元格 根据以下步骤:

步骤1:选择要隐藏零值行的范围。

步骤2:点击 库工具 > 选择工具 > 选择特定的单元格。 看截图:

步骤3:在弹出对话框中应用设置:

1。 选择 整行 在选择类型选项中;

2.将特定类型指定为 等于0和点击 OK。 看截图:

提示: 您可以在下面的框中添加其他条件以选择所需的单元格。

步骤4:已选择值为零的行,然后您可以 右键单击 选择的行 隐藏 在菜单中。

下面的示例显示如何通过以下方式选择零值的行 Kutools for Excel。 看截图:

提示:

1.要在整个工作表中隐藏值为零的单元格, 请点击查看更多…

2.要隐藏选定范围内零值的单元格, 请点击查看更多…

最佳办公生产力工具

🤖 Kutools 人工智能助手:基于以下内容彻底改变数据分析: 智能执行   |  生成代码  |  创建自定义公式  |  分析数据并生成图表  |  调用 Kutools 函数...
热门特色: 查找、突出显示或识别重复项   |  删除空白行   |  合并列或单元格而不丢失数据   |   不使用公式进行四舍五入 ...
超级查询: 多条件VLookup    多值VLookup  |   跨多个工作表的 VLookup   |   模糊查询 ....
高级下拉列表: 快速创建下拉列表   |  依赖下拉列表   |  多选下拉列表 ....
列管理器: 添加特定数量的列  |  移动列  |  切换隐藏列的可见性状态  |  比较范围和列 ...
特色功能: 网格焦点   |  设计图   |   大方程式酒吧    工作簿和工作表管理器   |  资源库 (自动文本)   |  日期选择器   |  合并工作表   |  加密/解密单元格    按列表发送电子邮件   |  超级筛选   |   特殊过滤器 (过滤粗体/斜体/删除线...)...
前 15 个工具集12 文本 工具 (添加文本, 删除字符,...)   |   50+ 图表 类型 (甘特图,...)   |   40+ 实用 公式 (根据生日计算年龄,...)   |   19 插入 工具 (插入二维码, 从路径插入图片,...)   |   12 转化 工具 (小写金额转大写, 货币兑换,...)   |   7 合并与拆分 工具 (高级组合行, 分裂细胞,...)   |   ... 和更多

使用 Kutools for Excel 增强您的 Excel 技能,体验前所未有的效率。 Kutools for Excel 提供了 300 多种高级功能来提高生产力并节省时间。  单击此处获取您最需要的功能...

产品描述


Office Tab 为 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