Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
One way:
Public Sub SearchAndHide() Dim rCell As Range Dim rHide As Range For Each rCell In Range("A12:A5000") With rCell If IsDate(.Value) Then If rHide Is Nothing Then Set rHide = .Cells Else Set rHide = Union(rHide, .Cells) End If End If End With Next rCell If Not rHide Is Nothing Then _ rHide.EntireRow.Hidden = True End Sub In article , acarril wrote: I've been using vb to find rows and hide them based on key text. I now need to hide rows based on a date (they vary). Can someone please help? Sub search() Dim cell As Range Application.ScreenUpdating = False For Each cell In Range("A12:A5000") If cell.Value = "RTRSSTCK" Then cell.EntireRow.Hidden = True ElseIf cell.Value = 1 Then cell.EntireRow.Hidden = False End If Next Application.ScreenUpdating = True End Sub --- Message posted from http://www.ExcelForum.com/ |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Group rows (or hide rows) like in MS Project | Excel Worksheet Functions | |||
Macro code to hide rows and not calculate hidden rows | Excel Discussion (Misc queries) | |||
Enabling option „Format rows“ to hide/unhide rows using VBA-code? | Excel Discussion (Misc queries) | |||
Concatenate several dates and hide 1/00/00 | Excel Discussion (Misc queries) | |||
Hide Rows - copy and paste only rows that show | Excel Worksheet Functions |