Using Macro to Hide Rows with Certain Values

G

Gap from Target

Hi:

I want to use macro to hide rows with certain values. For example, cell C7
has a value of "E- Express" and cell C8 has a value of "R- Regular". I want
to write a macro to hide rows only with "E- Express" and "R- Regular in
column "C" starting at C7 and end at C751. I don't want to this manually.
 
J

JMay

Sub HideMyStuff()
Dim R As Range
Set R = Range("C7:C751")
For Each c In R
If c.Value = "E-Express" Or c.Value = "R-Regular" Then
c.EntireRow.Hidden = True
End If
Next c
End Sub
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top