Hi, pnmng49,
looking at your workbooks Iīd tend to copy all into a new workbook and filter there.
You need to adjust one line in the code as the first worksheet in every workbook seems to be "Logon" (change 1 to 2):
' Change this range to fit your own needs.
With mybook.Worksheets(2)
Code to be used on the new workbook (macro recordings slightly worked on):
Sub FilterOnDate()
With ActiveWorkbook.ActiveSheet.Sort
.SortFields.Clear
.SortFields.Add Key:=Range("B1:B" & Cells(Rows.Count, "B").End(xlUp).Row) _
, SortOn:=xlSortOnValues, Order:=xlAscending, DataOption:=xlSortNormal
.SetRange Range("A1").CurrentRegion
.Header = xlGuess
.MatchCase = False
.Orientation = xlTopToBottom
.SortMethod = xlPinYin
.Apply
End With
Rows("1:1").Insert Shift:=xlDown, CopyOrigin:=xlFormatFromLeftOrAbove
With Range("B1")
.Value = "Date"
.Select
.AutoFilter
End With
ActiveSheet.Range("$A$1:$E$1").AutoFilter Field:=2, Operator:= _
xlFilterValues, Criteria2:=Array(2, "5/1/2012")
End Sub
Worked with Excel2007 on WinServer2003 for me.
Ciao,
Holger
Bookmarks