I have a large amount of data spread throughout 3 columns on a worksheet in excel. I want to match identical values in columns A & B while keeping values associated with column B inline with their respective B components. Here is an example:
What I have-
A B C
1 a g '
2 b h *
3 c a ?
4 d e $
5 e b /
6 f j )
7 g c #
8 h d @
9 i
10 j
What I am looking to achieve:
A B C
1 a a ?
2 b b /
3 c c #
4 d d @
5 e e $
6 f
7 g g '
8 h h *
9 i
10 j j )
I found this code, but it doesn't also carry over the 3rd column values.
Sub Macro1()
Dim rng1 As Range
Set rng1 = Range([a1], Cells(Rows.Count, "A").End(xlUp))
rng1.Offset(0, 1).Columns.Insert
With rng1.Offset(0, 1)
.FormulaR1C1 = _
"=IF(ISNA(MATCH(RC[-1],C[1],0)),"""",INDEX(C[1],MATCH(RC[-1],C[1],0)))"
.Value = .Value
End With
End Sub
Any help would be greatly appreciated! Thanks