What is an efficient way to find values in a range, eg Range(“A1:A2”), that exist in the same order within a second range, eg Range(“B:B”).
My seach has only come up with two possibilities so far:
1) Using a loop to iterate through the second range.
2) Using Range(“B:B”).Find to search for the value in “A1” and then testing for the value of A2 in the consecutive cell. Values in Range(“B:B”) is not unique so need to to keep finding until nothing found.
Is there another option I haven’t considered?
While (2) sounds sensible, another quick way would be to concatenate B1 and B2 into a single cell in a working column ( manually or with VBA), repeating for B2 & B3 Etc, and then match the combined string in a single lookup
[Update]
You could use a working column like so. The || concatenator is used to avoid false matches, an error check handles the no match situation