Fonction Si avec rechercheV

Bonjour à tous,

j'ai une rechercheV qui me renvoie #N/A, je souhaiterai mettre la condition de façon a tester la valeur avant de faire mes recherhcheV pour compléter mon fichier

=SI(ESTERREUR(RECHERCHEV($A11;$U$3:$AM$20;1;FAUX))=VRAI;"";"ok")

merci par avance de votre aide

philippe

4test.xlsm (19.08 Ko)

Bonjour;

J'espère que cela correspond à votre demande.

Cdlt,

4testv1.xlsm (20.21 Ko)

Bonjour Akam

merci pour ton retour , j'ai oublié de préciser que je le voulais en VBA.

Sub test()

Dim ligne As String
ligne = 3

Do While Cells(ligne, 1).Value <> ""

=SI(ESTERREUR(RECHERCHEV($A11;$U$3:$AM$20;1;FAUX))=VRAI;"";"ok")

 With Cells(ligne, 8)
   .Formula = "=VLOOKUP(RC1,R3C21:r100c39,8,FALSE)"
   .Value = .Value
   If .Value = 0 Then
    .Value = " "
    End If
    End With

  With Cells(ligne, 9)
   .Formula = "=VLOOKUP(RC1,r3c21:r100c39,9,FALSE)"
   .Value = .Value
       If .Value = 0 Then
    .Value = " "
    End If
    End With

 With Cells(ligne, 10)
   .Formula = "=VLOOKUP(RC1,r3c21:r100c39,10,FALSE)"
   .Value = .Value
      If .Value = 0 Then
    .Value = " "
    End If
    End With

    ligne = ligne + 1
    Loop

End Sub

Je n'ai pas assez de connaissance en vba pour écrire la fonction Si avec esterreur

Merci pour votre aide

philippe

Bonjour,
Une proposition !?
Cdlt.

Sub Test_JE()
Dim r As Range, lastRow As Long, lRow As Long, n
    With ActiveSheet
        Set r = .Range("U3:AM20")
        lastRow = .Cells(.Rows.Count, 1).End(xlUp).Row
        For lRow = 3 To lastRow
            n = Application.Match(.Cells(lRow, 1).Value, r.Columns(1), 0)
            If Not IsError(n) Then
                .Cells(lRow, 8).Value = Application.Index(r.Columns(8), n)
                .Cells(lRow, 9).Value = Application.Index(r.Columns(9), n)
                .Cells(lRow, 10).Value = Application.Index(r.Columns(10), n)
            End If
        Next lRow
    End With
End Sub

Bonjour,

Avec vlookup

Sub test()

Dim ligne As String
ligne = 3

Do While Cells(ligne, 1).Value <> ""
' ******* ligne ajoutee 
If IsError(Application.VLookup(Sheets("Feuil1").Range("A" & ligne), Sheets("Feuil1").Range("U3:AM20"), 8, False)) = False Then

 With Cells(ligne, 8)
   .Formula = "=VLOOKUP(RC1,R3C21:r100c39,8,FALSE)"
   .Value = .Value

   If .Value = 0 Then
    .Value = " "
    End If
    End With

  With Cells(ligne, 9)
   .Formula = "=VLOOKUP(RC1,r3c21:r100c39,9,FALSE)"
   .Value = .Value
       If .Value = 0 Then
    .Value = " "

End If
    End With

 With Cells(ligne, 10)
   .Formula = "=VLOOKUP(RC1,r3c21:r100c39,10,FALSE)"
   .Value = .Value
      If .Value = 0 Then
    .Value = " "
    End If
    End With
   ' ******* ligne ajoutee 
 End If

    ligne = ligne + 1
    Loop

End Sub

Cdlt

Bonjour Jean Eric et fg2b;

merci pour votre aide , j'ai opté pour la proposition de Fg2b, elle me parlé plus. je viens de l'ajouter à mon code et ça fonctionne.

encore merci à vous 2.

philippe

Rechercher des sujets similaires à "fonction recherchev"