Forum Discussion
EK_Blackwell
Jul 15, 2022Copper Contributor
Display row if cell = value
How do I display or hide a row if a cell = a certain value? A real basic example: Show row 7 if I7 = REQUIRED I'm trying if statements but not sure if the result is Hide/Unhide. Other suggest...
OliverScheurich
Jul 15, 2022Gold Contributor
Sub hide_unhide()
Dim i As Long
For i = 5 To 26
If Cells(i, 9).Value = "Required" Then
Rows(i).EntireRow.Hidden = True
Else
End If
Next i
End SubYou can try these lines of code. In the attached file you can click the button in cell F2 to run the macro. In order to unhide the rows change line 8 of the code to:
Rows(i).EntireRow.Hidden = False