Results 1 to 3 of 3
  1. #1
    Gold Lounger
    Join Date
    Jan 2004
    Location
    Italy
    Posts
    3,245
    Thanks
    0
    Thanked 0 Times in 0 Posts

    find value with 2 param (2000)

    admit have 2 var:
    COD = NX (based to find in column G)
    REGIONE = CAMPANIA (based to find in column N)

    ho to find the value in column I and in column J (in this case the line is 30) and after found the value in I and J store the 2 value in Var_Found = OI42343 & OI41991

  2. #2
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

    Re: find value with 2 param (2000)

    You can use this function:

    Function FindIt(strVal1 As String, strVal2 As String) As String
    Dim r As Long
    Dim m As Long
    m = Range("G" & Rows.Count).End(xlUp).Row
    For r = 2 To m
    If Range("G" & r) = strVal1 And Range("N" & r) = strVal2 Then
    FindIt = Range("I" & r) & " & " & Range("J" & r)
    Exit For
    End If
    Next r
    End Function

    Example of its use:

    Dim Var_Found As String
    Var_Found = FindIt("NX", "CAMPANIA")

  3. #3
    Gold Lounger
    Join Date
    Jan 2004
    Location
    Italy
    Posts
    3,245
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: find value with 2 param (2000)

    Naturally excellent code and good explian to use function.
    Tks.

Posting Permissions

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