This is a small example
Do you use a userform to ask the user for the dates or do you want to use a inputbox ?
Remember that there must be a good error check to see if the user enter a real date
Sub Delete_with_Autofilter_Two_Criteria()
Dim DeleteValue1 As String
Dim DeleteValue2 As String
Dim rng As Range
DeleteValue1 = "<=1/10/2006"
DeleteValue2 = "=1/25/2006"
With ActiveSheet
.Range("A1:A100").AutoFilter Field:=1, Criteria1:=DeleteValue1, _
Operator:=xlAnd, Criteria2:=DeleteValue2
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
End Sub
--
Regards Ron de Bruin
http://www.rondebruin.nl
"lpdarspe" wrote in message ...
Hello Ron,
I would like to have a macro.
Regards,
LPDARSPE
"Ron de Bruin" wrote:
Hi lpdarspe
You can use EasyFilter to do this
http://www.rondebruin.nl/easyfilter.htm
Or do you want a macro ?
--
Regards Ron de Bruin
http://www.rondebruin.nl
"lpdarspe" wrote in message ...
I have a spreadsheet with 12 columns of data and one column has dates. I
need a macro to delete out rows of information that are less than date1 and
greater than date2. Ihis will leave information that is greater than or
equal to date1 and less than or equal to date2. In the macro I need ask for
and get date1 and date2 for input from the user.
I tried recording the steps and inputing the date1 and date2 in certain
cells prior to this, but it did not duplicate it when I ran it again.