Hi guys,
I have a little problem with my vba formula.
I need it to work in a way, that if the cell in the columns B (cells B9:B65) contains "hide" , the entire row should be hidden. I was using the code below:
Sub Hide_Rows()
Dim c As Range
For Each c In Range("B9:B65").Cells
If c.Value = "Hide" Then
c.EntireRow.Hidden = True
End If
End Sub
The code needs to work dynamically - the values in column B are based on a formula from another sheet and are often updated. The idea is that macro runs after clicking a button and the search can be re-done anytime. The problem is that the code runs correctly once, but then it doesn't not search among the hidden rows from the previous search..
Can this be somehow fixed?
I have a little problem with my vba formula.
I need it to work in a way, that if the cell in the columns B (cells B9:B65) contains "hide" , the entire row should be hidden. I was using the code below:
Sub Hide_Rows()
Dim c As Range
For Each c In Range("B9:B65").Cells
If c.Value = "Hide" Then
c.EntireRow.Hidden = True
End If
End Sub
The code needs to work dynamically - the values in column B are based on a formula from another sheet and are often updated. The idea is that macro runs after clicking a button and the search can be re-done anytime. The problem is that the code runs correctly once, but then it doesn't not search among the hidden rows from the previous search..
Can this be somehow fixed?