0
我用下面的代碼基於單元格的值隱藏行:顯示行根據單元格的值 - Excel的VBA
Sub HideN()
Dim RowCnt As Long, uRng As Range
BeginRow = 8
EndRow = 232
ChkCol = 6
For RowCnt = BeginRow To EndRow
If Cells(RowCnt, ChkCol).Value = 0 Then
If uRng Is Nothing Then
Set uRng = Cells(RowCnt, ChkCol)
Else
Set uRng = Union(uRng, Cells(RowCnt, ChkCol))
End If
End If
Next RowCnt
If Not uRng Is Nothing Then uRng.EntireRow.Hidden = True
End Sub
我有什麼改變,如果我也想取消隱藏行,其中的單元格值是1?
在此先感謝!
MD
一個布爾值設置爲布爾表達式的結果的一個很好的例子 - +1 – YowE3K