I am hoping to find a way to make the code below work.

Sub test()

Dim Dup As String
Dim j As Integer

 For j = 3 To 21
        If ActiveSheet.Cells(j, "B").Text = Right(ActiveSheet.Cells(j, "B"), 3) Then
            ActiveSheet.Cells(j, "B").Value = Left(ActiveSheet.Cells(j, "G"), 7)
        End If
    Next j

Dup = ActiveSheet.Cells(j, "B").Value

MsgBox Dup

End Sub
Basically I have values in the 'A' Column that looks something Like This:


I want the data to display like this: