Hiding rows that meet multiple conditions in excel

K

KBV

This is my first time writing a VBA code (custom module). I want to learn how
to write a code that will ask excel to hide rows where a specific criteriia
is met. For ex, " hide all rows where col C has the words 'network' in it".

Or, can I write an if statement in excel to do this??

Thank you!
 
E

excelent

Sub tst()

r = Cells(65500, 3).End(xlUp).Row
For t = 1 To r
If Cells(t, 3) = "network" Then
Cells(t, 3).EntireRow.Hidden = True
End If
Next

End Sub



"KBV" skrev:
 
Top