Unanswered: Find an item in an array (Excel 97 VBA)
The following simple lookup routine doesn't work
It tries to find target t in an sorted array a, or the place where it should be.
while (i<=n) and (a(i)<t)
The array check is evaluated before the 'and' operator.
A function call has the same problem.
And, believe it or not, ...
won't work because the function 'Min' does not exist.
Of course I wrote my own Function Min(i1,i2) now.
Does anybody has a more elegant solution.
In XL we can use a total different approach then what we usually use in VB/VB.Net:
Dim vaList As Variant, vaValue As Variant, vaOutput As Variant
vaList = VBA.Array("A", "B", "C", "D", "E", "F", "G")
vaValue = "D"
vaOutput = _
Application.VLookup(vaValue, Application.Transpose(vaList), 1, 0)
If Not IsError(vaOutput) Then
MsgBox "The value " & vaValue & " exist!"
MsgBox "The value " & vaValue & " does not exist!"