1、按alt+F11打开VBE
2、例如,A:G列单元格中,只要有一个单元格为0,那么该行隐藏,代码如下:
Sub aa()
Dim i As Integer
For i = 1 To [a65536].End(xlUp).Row
If WorksheetFunction.Product(Range("A" & i & ":G" & i)) = 0 Then
Rows(i).Hidden = True
End If
Next i
End Sub
打开VBE编辑器,复制粘贴代码,运行后即可达到目的。