Code: Select all
into the top of module:
Dim strDBRows() As Variant
....
..........
SQL = "SELECT ABICODE, DESCRIZIONE, CABCODE FROM CAB ORDER BY ABICODE, CABCODE"
Set RS = New ADODB.Recordset
RS.Open SQL, CONN, adOpenStatic, adLockReadOnly, adCmdText
Y = RS.RecordCount
Erase strDBRows()
strDBRows = RS.GetRows(Y)
RS.Close
Set RS = Nothing
...........
Call StringAlong
............
Sub StringAlong()
Dim Sample As String
Sample = "01005"
If UBound(Filter(strDBRows, Sample)) >= 0 Then
MsgBox ("found it")
Else
MsgBox ("did not find it")
End If
End Sub
i need to chek if exists and return the postion number of founded value
have error rintime 13 in:
If UBound(Filter(strDBRows, Sample)) >= 0 Then
note;
the array can contain approx 2.500.000 items and i dont want to ceckh the value with a for next loop