jessieo387
New Member
- Joined
- Jun 10, 2009
- Messages
- 40
Hello,
I am trying to write so simple code to hide rows based on dates entered.
Here is the code:
Sub HideRows()
For Each cell In ActiveSheet.Range("A6:A380")
If cell.Value < "B1" Or cell.Value > "B2" Then cell.EntireRow.Hidden = True
Next
End Sub
Cells A6:A380 are dates and cell B1 is the start date and cell B2 is the end date. The data on this Worksheets is for the entire year, and I want to be able to select just certain data to view and have the other data hidden.
Thanks,
Jessica
I am trying to write so simple code to hide rows based on dates entered.
Here is the code:
Sub HideRows()
For Each cell In ActiveSheet.Range("A6:A380")
If cell.Value < "B1" Or cell.Value > "B2" Then cell.EntireRow.Hidden = True
Next
End Sub
Cells A6:A380 are dates and cell B1 is the start date and cell B2 is the end date. The data on this Worksheets is for the entire year, and I want to be able to select just certain data to view and have the other data hidden.
Thanks,
Jessica