I'm attempting to automate a daily report that I have but I'm running into trouble with the use of autofilter in VBA. The first value that I am attempting to calculate is the "average cycle time" in "sheet1" column G. I have several criteria that need to be applied but for some reason when I run the VBA I can't get the selection of criteria right. The multiple criteria should be returning several rows of results upon which the "average cycle time" bases its calculation, but the autofilter is returning only one row which isn't correct. It would be much appreciated if anyone can take a look at this and tell me where I'm going wrong.
[CODE]Sub Filter_Stuff()
Dim LR As Long, idate As Long, iMonth As Long, idynrange As Long, AR As Variant
' With Sheets("Sheet1")
' If Not .AutoFilterMode Then
' .Range("a1").AutoFilter
'End If
idate = Sheets("Totals").Cells(2, 8).Value
iMonth = Sheets("Totals").Cells(2, 9).Value
'iDate = "=*" & iYear & "*"
'iMonth = "=*" & iMonth & "*"
Sheets("Sheet1").Activate
idynrange = Range("a" & Rows.Count).End(xlUp).Row + 1
'Sheets("Sheet1").Rows("1:1").Select
Sheets("Sheet1").Range("$A$1:$AZ$" & idynrange).Select
Selection.AutoFilter
Sheets("Sheet1").Range("$A$1:$AZ$" & idynrange).AutoFilter Field:=4, Criteria1:=idate
Sheets("Sheet1").Range("$A$1:$AZ$" & idynrange).AutoFilter Field:=6, Criteria2:="<=15"
Sheets("Sheet1").Range("$A$1:$AZ$" & idynrange).AutoFilter Field:=1, Criteria3:="BOB"
Sheets("Sheet1").Range("$A$1:$AZ$" & idynrange).AutoFilter Field:=5, Criteria4:="=NEW", Operator:=xlOr, Criteria2:="=Refill"
Sheets("Sheet1").Range("g2").CurrentRegion.SpecialCells(xlCellTypeVisible).Cells(2, 7).Copy
Sheets("Totals").Select
Range("B2").Select
Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _
:=False, Transpose:=False
Bookmarks