I need to get the unique values between Column (A) and Column (C) to be shown in Column (E)
Asked
Active
Viewed 4,418 times
1
-
Do you want values that appear in column **A** or column **C**, but not both?? – Gary's Student Aug 17 '15 at 13:51
-
i need to compare the values between Column(A) and Column(C) and show the unique at Column (E). – Abdo El Husseini Aug 17 '15 at 13:54
-
Do a vlookup both ways.... takes 2 min. – findwindow Aug 17 '15 at 14:01
-
thanks findwindow but i need to mak it over VBA Code – Abdo El Husseini Aug 17 '15 at 14:19
1 Answers
1
This code:
Sub GetUniques()
Dim Na As Long, Nc As Long, Ne As Long
Dim i As Long
Na = Cells(Rows.Count, "A").End(xlUp).Row
Nc = Cells(Rows.Count, "C").End(xlUp).Row
Ne = 1
For i = 1 To Na
Cells(Ne, "E").Value = Cells(i, "A").Value
Ne = Ne + 1
Next i
For i = 1 To Na
Cells(Ne, "E").Value = Cells(i, "C").Value
Ne = Ne + 1
Next i
Range("E:E").RemoveDuplicates Columns:=1, Header:=xlNo
End Sub
will produce this type of result:

Gary's Student
- 95,722
- 10
- 59
- 99
-
Dears it's wonderful but i need it like below . Column(A) Mike Joe Ralph Column(c) Mike joe Column(E) Ralph – Abdo El Husseini Aug 17 '15 at 14:39