troubleshooting Question

Hide rows that contain a specific value

Avatar of AndresHernando
AndresHernando asked on
Microsoft Excel
5 Comments1 Solution636 ViewsLast Modified:
My code is too slow.  Is there a faster way to hide rows for a range based on the value of the cells?  
I want to hide all the rows in myRange when the cell value = 1

This is what I have now:

        For Each cCell In Range("myRange")
            If cCell.Value = 1 Then
                cCell.EntireRow.Hidden = True
                cCell.EntireRow.Hidden = False
            End If
        Next cCell
Rob Henson
Finance Analyst

Our community of experts have been thoroughly vetted for their expertise and industry experience.

Join our community to see this answer!
Unlock 1 Answer and 5 Comments.
Start Free Trial
Learn from the best

Network and collaborate with thousands of CTOs, CISOs, and IT Pros rooting for you and your success.

Andrew Hancock - VMware vExpert
See if this solution works for you by signing up for a 7 day free trial.
Unlock 1 Answer and 5 Comments.
Try for 7 days

”The time we save is the biggest benefit of E-E to our team. What could take multiple guys 2 hours or more each to find is accessed in around 15 minutes on Experts Exchange.

-Mike Kapnisakis, Warner Bros