View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
Bob Phillips[_6_] Bob Phillips[_6_] is offline
external usenet poster
 
Posts: 11,272
Default data between the dates

Sub Test()
Dim iLastRow As Long
Dim i As Long

iLastRow = Cells(Rows.Count, "A").End(xlUp).Row
For i = iLastRow To 1 Step -1
If Cells(i, "A").Value = DateSerial(2006, 4, 1) And _
Cells(i, "A").Value <= DateSerial(2006, 4, 31) Then
Rows(i).Delete
End If
Next i

End Sub


--

HTH

Bob Phillips

(remove nothere from the email address if mailing direct)

"Purnima Sharma" wrote in message
...
I have a worksheet from which I have to select the rows where the setup

date
is between 5/1/06 and 5/31/06 and delete all other rows. How can I achieve
that programmatically? Also, how can I apply multiple conditions to get

the
same results. Thanks.
Purnima