View Single Post
  #1   Report Post  
Posted to microsoft.public.excel.programming
Ron Coderre Ron Coderre is offline
external usenet poster
 
Posts: 2,118
Default Filtering on String Length

Perhaps something like this?:

Worksheets("Sheet1").Range("A1").AutoFilter _
field:=1, _
Criteria1:="????????", _
VisibleDropDown:=False

Does that help?
--------------------------

Regards,

Ron (XL2003, Win XP)
Microsoft MVP (Excel)


"Keith Wilby" wrote in message
...
What VBA code would I need to set a filter based upon string length in a
cell, for example, if I wanted to filter column A for those entries 8
characters in length?

I found this in the help:

Worksheets("Sheet1").Range("A1").AutoFilter _
field:=1, _
Criteria1:="Otis"
VisibleDropDown:=False

but I don't know how adapt that for my needs. I guess I need to use the
Len function somewhere in there.

A little background - I am creating and formatting the spreadsheet from
within MS Access.

Many thanks.
Keith.