Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 4,624
Default hide rows with any dates

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/

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default hide rows with any dates

thanks that worked!
how would i re-write the code to delete entire row with either text o
date

--
Message posted from http://www.ExcelForum.com

Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Group rows (or hide rows) like in MS Project Annie1904 Excel Worksheet Functions 2 October 17th 09 05:15 AM
Macro code to hide rows and not calculate hidden rows bradmcq Excel Discussion (Misc queries) 0 September 1st 09 12:38 AM
Enabling option „Format rows“ to hide/unhide rows using VBA-code? ran58 Excel Discussion (Misc queries) 0 July 28th 09 03:46 PM
Concatenate several dates and hide 1/00/00 Jeff Excel Discussion (Misc queries) 5 July 7th 06 12:26 PM
Hide Rows - copy and paste only rows that show Access101 Excel Worksheet Functions 3 March 1st 06 01:39 AM


All times are GMT +1. The time now is 11:22 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"