View Single Post
  #5   Report Post  
Posted to microsoft.public.excel.programming
OssieMac OssieMac is offline
external usenet poster
 
Posts: 2,510
Default Autofilter question

Hi chad,

I am assuming that you tried recording this and while the filter worked in
the interactive mode; when you run the code it does not work. The answer is
to insert a leading equal sign.

"=60 days past due"

A tip for these things is the following code. Set the filter then run the
code and you will be able to see the criteria that needs to be used for the
code.

Dim strCriteria

With Worksheets("Sheet1")
If .AutoFilterMode Then
With .AutoFilter.Filters(2)
If .On Then strCriteria = .Criteria1
End With
End If
End With

MsgBox strCriteria


--
Regards,

OssieMac


"Chad" wrote:

I have an autofilter with a column of data that includes operators such as
and <.

For example, one of the records would read " 60 days past due"

How would I go about coding the criteria to show the records that display "
60 days past due"?

Thanks,
Chad