Autofilter character limit in cell to search?

jpkeller55

New Member
Joined
May 27, 2004
Messages
11
Does anybody know if there is a character limit for an autofilter search in Excel 2003? I am using the code below on a button that a user can input filter criteria for a cell that contains the input string. However, it looks like the filter is not finding strings in cells when the string is past 250 characters or so. Is this known and is there a work around? Thanks for any help.

Code:
'Variables used by the macro
Dim FilterCriteria
Dim CurrentFileName As String

'Get the current file's name
CurrentFileName = ActiveWorkbook.Name

On Error Resume Next
ActiveSheet.AutoFilterMode = False
On Error GoTo 0
'Apply Autofilter
Range("A2:z10000").AutoFilter
'Get the filter's criteria from the user
FilterCriteria = InputBox("Enter Drug Name")
If FilterCriteria = "" Then Exit Sub
FilterCriteria = Replace(FilterCriteria, "*", "")
FilterCriteria = "*" & FilterCriteria & "*"
'Filter the data based on the user's input
Range("A2:z10000").AutoFilter field:=16, Criteria1:=FilterCriteria, Operator:=xlOr, Criteria2:="=UNIVERSAL"
 

Excel Facts

Show numbers in thousands?
Use a custom number format of #,##0,K. Each comma after the final 0 will divide the displayed number by another thousand

Forum statistics

Threads
1,214,614
Messages
6,120,530
Members
448,969
Latest member
mirek8991

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top