I am creating several string arrays and attempting to use a function for each array on an excel sheet. It is supposed to go through each row and every row it counts to see if any of the strings match with the value in the currently active cell. I seem to get and error when i try to pass the string array to the function and get an empty value for the function parameter. Here is my code
the array
anArray = Array("string1", "string2", "string3")
the function
Function checkArray(a as Variant) as integer
Range("A1")
Dim count As Integer
count = a.Length - 1
Do While ActiveCell.Value <> ""
Do While count <> -1
If ActiveCell.Value = a(count) Then
checkArray = checkArray + 1
End If
count = count -1
Next i
ActiveCell.Offset(1, 0).Select
Loop
End Function
and i call it
checkArray(anArray)