You can try this:
Not very clean but I think it should serve your purpose.
Option Explicit
Sub Sample()
Dim ws1 As Worksheet, ws2 As Worksheet
Dim RngToUnstack As Range, cel As Range, cel1 As Range
Dim i As Long
Set ws1 = ThisWorkbook.Sheets("Sheet2")
Set ws2 = ThisWorkbook.Sheets("Sheet3")
Set RngToUnstack = ws1.UsedRange
'~~> just an alternative to .UsedRange
'Set RngToUnstack = ws1.Range("A1", "D" & ws1.Range("A" & _
ws1.Rows.Count).End(xlUp).Row)
'~~> construct your unique ID's in Worksheet 2
With ws2
RngToUnstack.Resize(, 1).Copy .Range("A1")
.Range("A1", .Range("A" & .Rows.Count).End(xlUp).Address).RemoveDuplicates 1, xlNo
End With
'~~> loop to populate the ID's
For Each cel1 In ws2.Range("A1", ws2.Range("A" & ws2.Rows.Count).End(xlUp).Address)
i = 0
For Each cel In RngToUnstack.Resize(, 1)
If cel.Value = cel1.Value Then
cel.Resize(, 3).Offset(0, 1).Copy cel1.Offset(0, (3 * i) + 1)
i = i + 1
End If
Next cel
Next cel1
End Sub
Result:
Suppose your sample data looks like this:

After running the macro will become like this:
