1 pièce(s) jointe(s)
formule matriciel en code vba
bonjour,
je veux transformer cette formule matriciel {=EQUIV(E1&G1;'MAI JUIN'!2:2&'MAI JUIN'!4:4;0)} en code vba
ci-joint le code que j'ai essayer
Code:
1 2 3 4 5 6 7 8 9 10 11
|
Dim result As Variant
Dim rangeToSearch As Range
Set rangeToSearch = Sheets("MAI JUIN").Range("E2:BP2,E4:BP4")
Dim matchResult As Variant
matchResult = Application.Match(Range("E1").Value & Range("G1").Value, rangeToSearch, 0)
If IsError(matchResult) Or matchResult = CVErr(xlErrNA) Then
result = "Valeur non trouvée"
Else
result = Application.Index(rangeToSearch, matchResult)
End If |
Pièce jointe 638438
mais ne fonctionne pas erreur 2042
cordialement
Nicogef