View Single Post
  #5   Report Post  
Posted to microsoft.public.excel.programming
Marc[_25_] Marc[_25_] is offline
external usenet poster
 
Posts: 11
Default Filter numbers with textbox using 123132*

On 31 Maj, 20:34, Dave Peterson wrote:
If those are real numbers (not text) in your field to be filtered, then I don't
think the wild card stuff will work the way you want.

It that field is really text, then ignore this message.





Marc wrote:

Hi,


I have a problem with my code. I have made a userform with a textbox
and am trying to filter a set of numbers in a column.


I can get it to work when I write the exact number in the textbox
which
is also in the list with numbers. But I want to use the "*" asterisk.


Lets say if 123123 is in list and the textbox-value is 1. Then the
number should not be filtered/hidden.


Private Sub TextBoxWorkCenter_Change()
Dim Criteria1 As Double 'Tried As
String


Criteria1 = Val(TextBoxWorkCenter.Value) 'Tried using: & "*"
and without Val()


Worksheets("test1").Range("B6:B1000").AutoFilter _
field:=1, _
Criteria1:=Criteria1 & "*", _
Operator:=xlOr, _
Criteria2:="Center*", _
VisibleDropDown:=False
End Sub


Hope that somebody can help me????


Cheers


Marc


--

Dave Peterson- Skjul tekst i anførselstegn -

- Vis tekst i anførselstegn -


Hi Dave,

Thanks for the tip.
They are real numbers, formated as numbers. There are no formulas in
the cells.

I hoped it would be possible. I know it is with text and wild cards.

Cheers

Marc