+ Reply to Thread
Results 1 to 3 of 3

Search cells for specific value

Hybrid View

Nu2Java Search cells for specific... 10-23-2012, 03:21 PM
Nu2Java Re: Search cells for specific... 10-23-2012, 04:42 PM
Nu2Java Re: Search cells for specific... 10-24-2012, 11:34 AM
  1. #1
    Forum Contributor
    Join Date
    04-03-2012
    Location
    Washington State
    MS-Off Ver
    Excel 365
    Posts
    340

    Search cells for specific value

    Hi, I have a userform where I am searching Sheet2, ColumnA for a value, if it finds the value then it performs a function. Now I need to divide that and find only certain values among those values to perform yet another function. I am stuck on how this needs to work in my last IF statement, if it finds THIS or THIS or THIS Then? How do I create the "OR"? I just get a type mismatch error.

    
        Dim strFind As String, rLookRnge As Range, vLookRnge As Range
    
        strFind = TextBox1 
        strFindJob = TextBox2
        Set rLookRnge = Sheets(1).Columns(1) 'Change to suit
        Set vLookRnge = Sheets(2).Columns(1) 'Sheet2 Pick and Send list
         
        If Application.WorksheetFunction.CountIf(rLookRnge, strFind) <> 0 Then
            MsgBox strFind & " already exists.  Please create a new A Number!", vbCritical
            Me.TextBox1.Enabled = True
            Me.TextBox1.SetFocus 'Change to suit
            Exit Sub
            End If
            
         If Application.WorksheetFunction.CountIf(vLookRnge, strFindJob) <> 0 Then
        
      'Check for specific job
        If Me.TextBox14.Value = "" And strFindJob = "142-ARDC" Or "80-777") Then
        MsgBox "You need to list separate Jobs with Qty's in the 'COMMENTS' box!", vbExclamation, "Message"
        Exit Sub
        End If
    Thanks for any help!

  2. #2
    Forum Contributor
    Join Date
    04-03-2012
    Location
    Washington State
    MS-Off Ver
    Excel 365
    Posts
    340

    Re: Search cells for specific value

    Can anyone help on this? I'm confused why it doesn't work.

  3. #3
    Forum Contributor
    Join Date
    04-03-2012
    Location
    Washington State
    MS-Off Ver
    Excel 365
    Posts
    340

    Re: Search cells for specific value

    Anyone out there? Please help!

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

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

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1