
Option Explicit
Function cerca_alto(valore, matrice)
Dim i As Variant
i = Application.Lookup(valore, matrice)
If IsError(i) Then
cerca_alto = matrice(1)
ElseIf i < valore Then
cerca_alto = matrice.Find(i).Offset(1)
Else
cerca_alto = i
End If
End Function |
