onthegreen03
Board Regular
- Joined
- Jun 30, 2016
- Messages
- 148
- Office Version
- 365
- Platform
- Windows
I have a very simple macro which hides an entire row if the cell values in column AS (rows 1 through 140) are "Yes". The code I am using is below. The macro does the job but takes 5-6 seconds to hide the necessary rows. Given the fact the range is very small I am thinking there might be a better way to write this so it runs a little faster. Does anyone have a suggestion? Thanks in advance.
Sub Hide_Rows_Containing_Value()
Dim c As Range
For Each c In Range("AS1:AS140").Cells
If c.Value = "Yes" Then
c.EntireRow.Hidden = True
End If
Next c
End Sub
Sub Hide_Rows_Containing_Value()
Dim c As Range
For Each c In Range("AS1:AS140").Cells
If c.Value = "Yes" Then
c.EntireRow.Hidden = True
End If
Next c
End Sub