Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default How to compare 2 lists in Excel VBA?

Hello All,

It's come to me to create a manner to compare 2 lists of computer
against eachother. I need to return all values from list 1 that ar
missing in list 2 and then return all values in list 2 that are missin
in list 1.

This will be used to compare what computers are checking in against ou
NAV servers to the list of computers we have in AD for that region.
Basically, when we do this by hand, we find computers from one regio
that should be using a different NAV server.


Unfortunately, it's been several years since my limited exce
programming and VBA training and I'm staring at my screen much lik
it's greek. I know it should be a simple task and any tips anyon
could add that could get my mind churning in the right direction woul
be much appreciated.

So far, I've been able to compare list1 to list2 and return th
differences with an example that I've found. The problem being, a
soon as list1 has a different value, the rest of the list is considere
different and returned as such.

In my mind, I picture the solution to look something like:

Range("A4:A500,C4:C500").select
value1 = rng1.value1(first value in range 1)
value2 = rng2.value1(first value in range 2)
if value1 < value2 then value2 = rng2.nextvalue(I'm not sure how t
move to the next value in a list)

I know the above doesn't work and I haven't gotten a logic loop yet...

Maybe it would be a good time to ask for help... so...

Help!

Thanks,

Chris

--
Message posted from http://www.ExcelForum.com

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27,285
Default How to compare 2 lists in Excel VBA?

easier just to put in a formula next to each list

assume list1 is in A1:A100 and List2 is in F1:F120
In B1 put in
=Countif($F$1:$F$120,A1)
then drag fill down to 100

in G1 put in
=countif($A$1:$A$100,F1)

then drag fill down column G to row 120

Now you can use a filter on each list, filtering on the column with the
formulas, and use 0 as the criteria (zero would indicate that the computer
in that list is not in the other list).

--
Regards,
Tom Ogilvy


"ChrisG " wrote in message
...
Hello All,

It's come to me to create a manner to compare 2 lists of computers
against eachother. I need to return all values from list 1 that are
missing in list 2 and then return all values in list 2 that are missing
in list 1.

This will be used to compare what computers are checking in against our
NAV servers to the list of computers we have in AD for that region.
Basically, when we do this by hand, we find computers from one region
that should be using a different NAV server.


Unfortunately, it's been several years since my limited excel
programming and VBA training and I'm staring at my screen much like
it's greek. I know it should be a simple task and any tips anyone
could add that could get my mind churning in the right direction would
be much appreciated.

So far, I've been able to compare list1 to list2 and return the
differences with an example that I've found. The problem being, as
soon as list1 has a different value, the rest of the list is considered
different and returned as such.

In my mind, I picture the solution to look something like:

Range("A4:A500,C4:C500").select
value1 = rng1.value1(first value in range 1)
value2 = rng2.value1(first value in range 2)
if value1 < value2 then value2 = rng2.nextvalue(I'm not sure how to
move to the next value in a list)

I know the above doesn't work and I haven't gotten a logic loop yet...

Maybe it would be a good time to ask for help... so...

Help!

Thanks,

ChrisG


---
Message posted from http://www.ExcelForum.com/



  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2,253
Default How to compare 2 lists in Excel VBA?


Why dont you download a trialversion of Synkronizer XL 8.0 from
http://www.synkronizer.com


It's an addin that'll do exactly what you want to do, and probably does
it faster and better then you could ever program it.

You can test it for 30 days before you'll need to buy.
User versions: $30 to $80, Developer version: $200


(and..yep.. I've developed a major part of it)

keepITcool

< email : keepitcool chello nl (with @ and .)
< homepage: http://members.chello.nl/keepitcool


ChrisG wrote:

Hello All,

It's come to me to create a manner to compare 2 lists of computers
against eachother. I need to return all values from list 1 that are
missing in list 2 and then return all values in list 2 that are
missing in list 1.

This will be used to compare what computers are checking in against
our NAV servers to the list of computers we have in AD for that
region. Basically, when we do this by hand, we find computers from one
region that should be using a different NAV server.

snap


Thanks,

ChrisG


---
Message posted from http://www.ExcelForum.com/



Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
How do I compare lists in cells Excel Gerald Vandiver Excel Worksheet Functions 0 June 14th 06 12:03 AM
how to compare multiple lists of data in excel DREAM MERCHANT Excel Discussion (Misc queries) 1 May 1st 06 01:09 PM
How do I compare lists in Excel? Jazz - Netherlands Excel Worksheet Functions 2 March 29th 06 09:16 AM
Excel - need a function to compare lists JerryMatson Excel Worksheet Functions 1 November 24th 05 04:09 PM
How do I compare two lists of names in excel? Jack the Cate Excel Discussion (Misc queries) 1 December 24th 04 12:07 PM


All times are GMT +1. The time now is 03:56 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"