View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
John[_131_] John[_131_] is offline
external usenet poster
 
Posts: 3
Default find differences between two columns

Hello David,

Have a go with the following code:

Sub CheckTheDifference()
Dim iRow As Integer
Dim iCol As Integer
Dim x As Integer

iRow = ActiveCell.Row
iCol = ActiveCell.Column

For x = 0 To 10
If Cells(iRow + x, iCol).Value < Cells(iRow + x, iCol + 1).Value
Then
MsgBox "The cells on row " & iRow + x & " do not match"
End If
Next x

End Sub

Hope that helps.

Best regards

John


"David Kennedy" wrote in message
...
Hi,

Can anyone show me how to find differences between two columns ie..
Col A Col B
100 100
106 108
2500 2500
2999 2999

106 is not in Col B and 108 is not in Col A.
can it be done using a function? ,could you also show me code to do this?

Thanks in advance ,
David