Dear Experts
I have set of data in Column A and column B i want result as common values of both A and B result in C column.....
I need vba code please help on this.....
Dear Experts
I have set of data in Column A and column B i want result as common values of both A and B result in C column.....
I need vba code please help on this.....
Try this:-
Or
![]()
Sub GetCommonValues() Dim oSD As Object, rMyRng As Range, nEndRw1 As Long, nEndRw2 As Long, r As Range Set oSD = CreateObject("Scripting.Dictionary") nEndRw1 = Cells(Rows.Count, "A").End(xlUp).Row nEndRw2 = Cells(Rows.Count, "B").End(xlUp).Row Set rMyRng = Union(Range("A2:A" & nEndRw1), Range("B2:B" & nEndRw2)) Application.ScreenUpdating = False With oSD .CompareMode = False For Each r In rMyRng If Not .Exists(r.Value) Then .Add r.Value, 1 Next r Range("C2").Resize(.Count, 1).Value = Application.Transpose(.Keys) End With Application.ScreenUpdating = True End Sub
If your problem is solved, then please mark the thread as SOLVED>>Above your first post>>Thread Tools>>
Mark your thread as Solved
If the suggestion helps you, then Click *below to Add Reputation
Thanks alot AB33.... works fine![]()
There are currently 1 users browsing this thread. (0 members and 1 guests)
Bookmarks