I have a formula on Worksheet 3 that looks at a specific cell on Worksheet 2.
=IF(ISTEXT(Sheet2!G10),Sheet2!D10,””)
On Worksheet 3, I want to hide any rows that have “” instead of text. Here’s my code so far:
Sub HURows()
BeginRow = 1
EndRow = 100
ChkCol = 4
For RowCnt = BeginRow To EndRow
If Cells(RowCnt, ChkCol).Value = 0 Then
Cells(RowCnt, ChkCol).EntireRow.Hidden = True
Else
Cells(RowCnt, ChkCol).EntireRow.Hidden = False
End If
Next RowCnt
End Sub
The way my macro is written it hides all of the rows between 1 and 100 that don’t have the formula in it.
Is there an easy fix? I just want my macro to look at the results of the formula and if the result is “” it should hide the row. If it places the cell value (D10), then the row should not be hidden.
Thanks!