Autofilter macro issues

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

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
 
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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top