Comparing Worksheet ranges

I

ibeetb

I would like to compare Range A and Range B and then be able to identify or
write out the items in A that re NOT in B.
Keep in mind,, that range B has unique items but Range A had several
instances of the same name....i.e. non-unique items. I have done this
successfiully via Array formulas in the wrksht, but it takes too long. I
would like to do in code. Any suggestions?
 
I

ibeetb

wHAT i ACTUALLY NEED TO DO IS do this in code.....not worksheet array
formulas....in the wrksht takes too long and your link was useful, but it
works easiest for wrksht formulas in the wrkshtr
 
M

Myrna Larson

If speed is the issue, VBA code will probably be SLOWER than the array formulas, not faster.

You can identify missing items with a COUNTIF or MATCH formula. Assuming you've named the ranges
RangeA and RangeB. Let's say RangeA starts in A2. RangeB starts in F2. In B2

=IF(COUNTIF(RangeB,A2)=0,"Missing from B","")

or

=IF(ISERROR(MATCH(A2,RangeB,0)),"Missing from B","")

and copy down through the last entry in RangeA.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top