I need help hiding rows using a macro. I have no prolem hiding an individual row based on a value, but I want to go one step further and given a value in one row, I want to hide that row and the next two rows. Below is what I have to hide an individual row:
Sub wind()
For a = 221 To 221
If Cells(a, 1) = 0 Then
Cells(a, 1).Select
Selection.EntireRow.Hidden = True
End If
Next a
End Sub
What I want to do is if A221=0, I want to hide not just row 221, but I want to hide rows 221-223. Can you help?
Sub wind()
For a = 221 To 221
If Cells(a, 1) = 0 Then
Cells(a, 1).Select
Selection.EntireRow.Hidden = True
End If
Next a
End Sub
What I want to do is if A221=0, I want to hide not just row 221, but I want to hide rows 221-223. Can you help?