Tom's Guide | Tom's Hardware | Tom's Games
![]() |
![]() |
![]() |
Hello,
Hopefully this is an easy one for someone. I have two columns of alphanumeric data that I want to compare. The data in each column is a list of computer names. I want to know what computers names in column A are NOT in colmun B. The output can be either in column C or in a seperate worksheet. Thanks in advance for any help you can give!Thanks.

Here are a couple of options. The VBA code will place the missing computer names in C1, C2, etc.
The formula will put the missing names in column C, but in the same row as the existing entry in column A.
Obviously you'll need to change the ranges to fit your sheets.
Sub CompareCols()
For Each cpu In Range("A1:A7")
With Range("B1:B7")
Set c = .Find(cpu, LookIn:=xlValues, LookAt:=xlWhole)
If c Is Nothing Then
myRow = myRow + 1
Range("C" & myRow) = cpu
End If
End With
Next
End SubThis is an array formula, which must be entered using Ctrl-Shift-Enter - do not type the brackets. Enter the formula in C1, hit Ctrl-Shift-Enter and drag down to bottom of the data in column A.
{=IF(AND(A1<>$B$1:$B$7),A1,"")}
After the values are in column C, you could do an Edit/Paste Special-Values, then sort.

![]() |
![]() |
![]() |

This post is quite old and has been locked from receiving new replies. Please create a new posting instead.
| Ads by Google |