Hiding rows based on a cell?

  • Thread starter Thread starter OX_Gambit
  • Start date Start date
O

OX_Gambit

Is there a way that I can hide a row based on a cells value? Or do I have to
run a macro to do so?

I will be positng this in the Programming section as well.
 
To truly hide, you would need a macro
However, you could make it look blank using conditional formatting making
the font colour match the worksheet background colour (generally white)
best wishes
 
Say we want to hide all rows in which column A contains "XXX":

Sub hideum()
Dim i As Long
n = Cells(Rows.Count, "A").End(xlUp).Row
For i = 1 To n
If Cells(i, 1).Value = "XXX" Then
Rows(i).Hidden = True
End If
Next
End Sub
 
sorry for tagging on to this old post but its very similar to a question i
have. but for starters, i simply copy/pasted the below macro on the "view
code".
i typed in various values down column A, including a couple of examples of
xxx.
anything else i can try? for proper protocol shoud i write a new request?
 
Back
Top