View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
Barb Reinhardt Barb Reinhardt is offline
external usenet poster
 
Posts: 3,355
Default delete rows with dates between

I've used something like this:

Dim DeleteValue As String
Dim rng As Range

DeleteValue = "File(s)"
' This will delete the rows with "File(s)" in the Range("A2:A65536")
With ActiveSheet
.Range("A2:A65536").AutoFilter Field:=1, Criteria1:="=*File(s)*"
' Need to figure out how to enter DeleteValue above

With ActiveSheet.AutoFilter.Range
On Error Resume Next
Set rng = .Offset(1, 0).Resize(.Rows.Count - 1, 1) _
.SpecialCells(xlCellTypeVisible)
On Error GoTo 0
If Not rng Is Nothing Then rng.EntireRow.Delete

End With
.AutoFilterMode = False
End With


It could probably be more elegant, but it works.

"dan" wrote:

Hi,

I have a spreadsheet, column J has dates ranging from June05 - June 06.
I want to delete the entire row if the date falls between 06/01/2005
and 12/31/2005, and merge all the rows up.

I have tried a few things on here but havent gotten them to work for my
situation.

Thank you in advance for any help!