I need to get the unique values between Column (A) and Column (C) to be shown in Column (E)
-
Do you want values that appear in column A or column C, but not both??Gary's Student– Gary's Student2015-08-17 13:51:48 +00:00Commented Aug 17, 2015 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– Abdo El Husseini2015-08-17 13:54:58 +00:00Commented Aug 17, 2015 at 13:54
-
Do a vlookup both ways.... takes 2 min.findwindow– findwindow2015-08-17 14:01:27 +00:00Commented Aug 17, 2015 at 14:01
-
thanks findwindow but i need to mak it over VBA CodeAbdo El Husseini– Abdo El Husseini2015-08-17 14:19:44 +00:00Commented Aug 17, 2015 at 14:19
Add a comment
|
1 Answer
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:
1 Comment
Abdo El Husseini
Dears it's wonderful but i need it like below . Column(A) Mike Joe Ralph Column(c) Mike joe Column(E) Ralph
