View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
Ben Ben is offline
external usenet poster
 
Posts: 509
Default Autofilter macro issues

Hi Fred,

I struggled with the same error. An alternatives that worked to solve my
problem is use Clng on your date as follows:
Criteria1:=CLng(Format(Date - 1, "mm/dd/yyyy 0:00"))
Otherwise try function Dateserial.

Good luck

Ben

"fgwiii" wrote:

Earlier this morning, I received code similar to this:

With ActiveSheet.UsedRange
.AutoFilter
.AutoFilter _
Field:=10, _
Criteria1:=Format(Date - 1, "mm/dd/yyyy 0:00")
End With

End Sub

The issue is that while this does appear make the correct selection in the
autofilter, the sheet comes up blank. If I manually click on the same
selection, then the data in the sheet is displayed.

Any thoughts?

Thanks,

Fred