Option Compare Text 'la casse est ignorée
Function EquivPlus(X As Variant, R As Range) As Variant
If Not IsEmpty(X) And (R.Rows.Count = 1 Or R.Columns.Count = 1) Then
Dim P As Range, i&
Set P = Intersect(R, Application.Caller.Parent.UsedRange)
If Not P Is Nothing Then
For i = 1 To P.Count
If P(i) = X Then
If R.Columns.Count = 1 Then EquivPlus = i + P.Row - R.Row _
Else EquivPlus = i + P.Column - R.Column
Exit Function
End If
Next
End If
End If
EquivPlus = [#N/A]
End Function
Function RechercheVPlus(X As Variant, R As Range) As Variant
If Not IsEmpty(X) Then
Set R = Intersect(R, Application.Caller.Parent.UsedRange)
If Not R Is Nothing Then
Dim i&
For i = 1 To R.Rows.Count
If R(i, 1) = X Then RechercheVPlus = R(i, R.Columns.Count): Exit Function
Next
End If
End If
RechercheVPlus = [#N/A]
End Function
Function RechercheHPlus(X As Variant, R As Range) As Variant
If Not IsEmpty(X) Then
Set R = Intersect(R, Application.Caller.Parent.UsedRange)
If Not R Is Nothing Then
Dim i%
For i = 1 To R.Columns.Count
If R(1, i) = X Then RechercheHPlus = R(R.Rows.Count, i): Exit Function
Next
End If
End If
RechercheHPlus = [#N/A]
End Function