Range.AutoFilter- Tell it to read numbers?

randomuser

New Member
Joined
Jul 22, 2022
Messages
5
Office Version
  1. 365
Platform
  1. Windows
I have a large table with 5 search options with only 4 working correctly. The one that is not working correctly filters with 0 results and then gets stuck there, where it doesn't turn off the filter when I remove the text in the search field. Two of the search boxes are for columns of letters and two are for columns with a mixture of letters of numbers, and they both work perfectly. The non working column is a list of four and five digit numbers. When I change just the field number in the formula it works. When I swap one of my working search boxes to read that column, it no longer works. I've changed the format to number in both the source table and reference cell for the search box, but no luck. Any ideas what I'm missing? Is there something I should add to the formula to tell it to read it correctly?


Private Sub v2_Change()
Application.ScreenUpdating = True
ActiveSheet.ListObjects("data").Range.AutoFilter Field:=31, Criteria1:="=*" & [P1] & "*", Operator:=xlFilterValues
Application.ScreenUpdating = True
End Sub
 

Excel Facts

Format cells as currency
Select range and press Ctrl+Shift+4 to format cells as currency. (Shift 4 is the $ sign).

Forum statistics

Threads
1,214,929
Messages
6,122,317
Members
449,081
Latest member
tanurai

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