1

I need to get the unique values between Column (A) and Column (C) to be shown in Column (E)

4
  • Do you want values that appear in column A or column C, but not both?? Commented 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). Commented Aug 17, 2015 at 13:54
  • Do a vlookup both ways.... takes 2 min. Commented Aug 17, 2015 at 14:01
  • thanks findwindow but i need to mak it over VBA Code Commented Aug 17, 2015 at 14:19

1 Answer 1

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:

enter image description here

Sign up to request clarification or add additional context in comments.

1 Comment

Dears it's wonderful but i need it like below . Column(A) Mike Joe Ralph Column(c) Mike joe Column(E) Ralph

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.