View Single Post
  #5   Report Post  
Posted to microsoft.public.excel.programming
Bob Phillips[_6_] Bob Phillips[_6_] is offline
external usenet poster
 
Posts: 11,272
Default Comparing two ranges and extracting non duplicate data

Range("F1").Formula = "=IF(COUNTIF(A:A,D1)=0,D1,"""")"

--

HTH

RP
(remove nothere from the email address if mailing direct)


"Knut Dahl" wrote in message
...
Thanks Tom,
can I use this in VBA code as well? I need this to be part of a bigger
procedure that I'm currently writing.
Thanks ;)

KJ

"Tom Ogilvy" wrote in message
...
in F1 put the formula
=if(countif(A:A,D1)=0,D1,"")

then drag fill down the column.

--
Regards,
Tom Ogilvy

"Knut Dahl" wrote in message
...
Good morning everyone.
I am currently trying to compare 2 ranges with each other.
One range is in column A and the other in column D.
Column D contain more data than Column A. I want to compare the 2

ranges
with each other and then extract all the data that are in column D, but

not
in column A and put them in a new column (F for example).
It might sound really easy, but I have tried various if...then and
do...while constructs, but it looks like I'm stuck logically.
Does anyone have a clever idea of how to solve this?
Any help is greatly apreciated.

Thanks guys

KJ