This seems to be about searching for text and functions interpreting
them into numbers.
To elaborate more specifically, somehow I need the routine to check if
the item from the first array is present in the second array, and if
so, which row is it on? Both arrays are text, but some can look like
values (i.e., 150, 0150) and others look only like text (i.e., T150,
150A).
Here's a snippet of what I'm doing now...
'cItemArray1 = lookup value from first array (looping all such items)
If Application.WorksheetFunction _
.CountIf(Range("a:a"), cItemArray1) = 0 Then 'not found
'code to record cItemArray1 as not found (exception)
Else 'countif found the item in array2...
'note row number of match in Array2
iMatchRow = Application.WorksheetFunction _
.Match(cItemArray1, Range("a:a"), 0)
When cItemArray1 = "010020" the countif finds 10020 in Array2, which
is incorrect. It then passes to the match function, which cannot find
010020 because it searches for the literal string, whereas the countif
interprets. The match function then throws an error, because the
countif showed the lookup as existing when it really didn't.
(I use the countif before the match because I can't figure out a way
to do an error handler for a match for a non-existant lookup - any
suggestions?)
I tried your code, but I get a type mismatch error when checking
twice. That's when a text string, which cannot be a number, is my
lookup. I'm sure it's choking on the syntax that removes the quotes.
As far as first converting the arrays to values, I added a routine
that first converts both arrays to text, so there's not a mix of
values and text. However, I can't convert them to numbers because
00569 will become 569, which will hose everything. My items, for
example, include 00569, 0569, 569, 00569T, and 569T.
Thanks for any advice.