Solved: excel 2003 column difference

Status
This thread has been Locked and is not open to further replies. Please start a New Thread if you're having a similar issue. View our Welcome Guide to learn how to use this site.

drafter

Thread Starter
Joined
Nov 21, 2000
Messages
419
I am using excel 2003 and I would like to compare to columns of numbers with each other and have third column produce the difference between the two. For example if the first column had 1, 2, 3, 4 and the second column had 3, 4, 5, 6 the third colums would have 1, 2, 5, 6. These are the numbers that ARE NOT common to each other. Hope I didn't make this more confusing than it is. Can anyone help me with this?

thanx
 
Joined
Jul 1, 2005
Messages
8,546
You could try a macro to loop through each list in turn (like the following, which assumes that the lists start in A1 and B1 respectively):

Sub Macro1()
For Each Cell In Range("A1", Range("A65536").End(xlUp))
If WorksheetFunction.CountIf(Range("B:B"), Cell) = 0 Then
x = WorksheetFunction.CountA(Range("C:C"))
Cell.Copy Range("C1").Offset(x, 0)
Else
End If
Next Cell
For Each Cell In Range("B1", Range("B65536").End(xlUp))
If WorksheetFunction.CountIf(Range("A:A"), Cell) = 0 Then
x = WorksheetFunction.CountA(Range("C:C"))
Cell.Copy Range("C1").Offset(x, 0)
Else
End If
Next Cell
End Sub
 

drafter

Thread Starter
Joined
Nov 21, 2000
Messages
419
that macro seems to get stuck on the following line.

x = WorksheetFunction.CountA(Range("D"))
 
Joined
Jul 1, 2005
Messages
8,546
drafter said:
that macro seems to get stuck on the following line.

x = WorksheetFunction.CountA(Range("D"))
I edited the original post (damn smilies), we may have crossed over. Try again?
 
Status
This thread has been Locked and is not open to further replies. Please start a New Thread if you're having a similar issue. View our Welcome Guide to learn how to use this site.

Users Who Are Viewing This Thread (Users: 0, Guests: 1)

As Seen On
As Seen On...

Welcome to Tech Support Guy!

Are you looking for the solution to your computer problem? Join our site today to ask your question. This site is completely free -- paid for by advertisers and donations.

If you're not already familiar with forums, watch our Welcome Guide to get started.

Join over 807,865 other people just like you!

Latest posts

Staff online

Members online

Top