Consulting

Results 1 to 3 of 3

Thread: Comparing text to cells but only partial match

  1. #1

    Comparing text to cells but only partial match

    i have the following


    If RangeAI.Value = cell.Value Or RangeAI.Value = "0000" Then
            NotEqual = False
    End If

    How do i chance the second bit so that it doesnt just hit on the entire string but also when it is only a partial hit? I know how to do that with find, but not with the value thing.

    probably a stupid question, but i really cant find the answer.

    TIA Frank

  2. #2
    Distinguished Lord of VBAX VBAX Grand Master Bob Phillips's Avatar
    Joined
    Apr 2005
    Posts
    25,453
    Location
    Quote Originally Posted by Regouin
    If RangeAI.Value = cell.Value Or RangeAI.Value = "0000" Then
    NotEqual = False
    End If

    How do i chance the second bit so that it doesnt just hit on the entire string but also when it is only a partial hit? I know how to do that with find, but not with the value thing.

    If RangeAI.Value = cell.Value Or RangeAI.Value Like "*0000*" Then 
        NotEqual = False 
    End If



  3. #3
    thanks, i was so close

    tried


    RangeAI.Value Like "0000"
    and tried


    RangeAI.Value = "*0000*"

    but didnt think of comparing them, it works beautifully thanks.

    Frank

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •