Cant search and filter specific number using vba

handri

Board Regular
Joined
Nov 25, 2017
Messages
88
Office Version
  1. 365
  2. 2021
Platform
  1. Windows
Hi,

whatever i tried. Cant search below number and filter it using vba.
NP ONLINE NEW FORMAT.xlsm
BC
10491044885012005010
DATA


others is ok is it any weird things ?

my search vba is ok

VBA Code:
Private Sub TextBox1_Change()
    ActiveSheet.ListObjects("TABLE4").Range.AutoFilter Field:=1, _
        Criteria1:="*" & [D2] & "*", Operator:=xlFilterValues
End Sub

Sub clearFilter()
    [D2] = ""
    ActiveSheet.ListObjects("TABLE4").Range.AutoFilter Field:=1
End Sub
 

Excel Facts

How to find 2nd largest value in a column?
MAX finds the largest value. =LARGE(A:A,2) will find the second largest. =SMALL(A:A,3) will find the third smallest
1) what do you have in D2
2) show us a bit more data and one that does work.
3) Is column B field 1 the of the Table the colouring seems to indicate it may not be part of the table
Wild cards on a number stored as a number won't work
 
Upvote 0
1) what do you have in D2
2) show us a bit more data and one that does work.
3) Is column B field 1 the of the Table the colouring seems to indicate it may not be part of the table
Wild cards on a number stored as a number won't work
hi

D2
NP ONLINE NEW FORMAT.xlsm
D
2
DATA


Data works

NP ONLINE NEW FORMAT.xlsm
C
1013GM-1A
DATA
Cells with Conditional Formatting
CellConditionCell FormatStop If True
C1074:C1048576,C1:C1048,C1050:C1057Cell ValueduplicatestextNO
C6:C1048,C1050:C1073Cell ValueduplicatestextNO


B field not part of the table

search not working in this

NP ONLINE NEW FORMAT.xlsm
C
1049885012005010
DATA



885012005010
 
Upvote 0
How is your data getting into the table ?
The way it looks to me, I would suggest formatting column 1 of your table as text.
If this is acceptable to you then once you have change it to text
To convert your numbers in column 1 to text:-
Data > Text to Columns > Delimited > Clear all delimiters > Text > Finish

Also format D2 as Text.

Let me know your thoughts or how you go with that.
 
Upvote 0
Solution
How is your data getting into the table ?
The way it looks to me, I would suggest formatting column 1 of your table as text.
If this is acceptable to you then once you have change it to text
To convert your numbers in column 1 to text:-
Data > Text to Columns > Delimited > Clear all delimiters > Text > Finish

Also format D2 as Text.

Let me know your thoughts or how you go with that.
Thanks its work. For item unable to search and filter. Convert to text will works.

thanks again
 
Upvote 0

Forum statistics

Threads
1,214,599
Messages
6,120,447
Members
448,966
Latest member
DannyC96

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