Bonjour,

Dans Excel j'utilise une fonction qui me permet selon 4 critères de me renvoyer un résultat.

Aujourd'hui, je suis sur Windows 11 et la fonction ne me renvoie plus de résultat mais une erreur #NOM?.

Est ce qu'en passant de Windows 10 à Windows 11, il y aurait des paramètres/références qui empêcherai le bon fonctionnement de la fonction.


La fonction

Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
 
Function GetSelection(Crit1 As String, Crit2 As String, Crit3 As String, Crit4 As String) As String
Dim table As Variant
Dim field As String
 
field = Worksheets("Process").Range("E3").Value
table = Range(field)
trouve = False
i = 1
y = UBound(table)
While Not trouve And i <= y
    If table(i, 1) = "*" Or table(i, 1) = Crit1 Then
        If table(i, 2) = "*" Or table(i, 2) = Crit2 Then
            If table(i, 3) = "*" Or table(i, 3) = Crit3 Then
                If table(i, 4) = "*" Or table(i, 4) = Crit4 Then
                    trouve = True
                    GetSelection = table(i, 6)
                End If
            End If
        End If
    End If
    i = i + 1
Wend
If Not trouve Then
    GetSelection = "#N/A"
End If
End Function
Par avance merci pour votre aide.

Cdt,