View Single Post
 
Old 06-19-2018, 03:30 PM
Logit Logit is offline Windows 10 Office 2007
Expert
 
Join Date: Jan 2017
Posts: 587
Logit is a jewel in the roughLogit is a jewel in the roughLogit is a jewel in the roughLogit is a jewel in the rough
Default

Code:
Option Explicit

Sub HideRowsContainingValue()
'Description: This macro will loop through a col and
'hide the row if the cell in Col A does not the value of A1.
    
Dim c As Range
Application.ScreenUpdating = False
    For Each c In Range("A2:A100").Cells
        If c.Value <> Range("A1").Value Then
            c.EntireRow.Hidden = True
        End If
    Next c
Application.ScreenUpdating = True

End Sub
The above macro will accomplish what you want in the workbook I provided.

Your original post indicated you wanted to view anything EQUAL TO or GREATER than the
STARTDATE, which is why the first macro was written as it was.

HTH
Reply With Quote