Pasting the following code into the VBA tab for Sheet2 will regenerate the required layout every time the sheet is activated.
Private Sub Worksheet_Activate()
Cells.Clear
For N = 1 To Sheets("Sheet1").Cells(65536, 1).End(xlUp).Row
If Application.CountIf(Columns(1), Sheets("Sheet1").Cells(N, 1)) = 0 Then
If Cells(1, 1) = "" Then
Cells(1, 1) = Sheets("Sheet1").Cells(N, 1)
TargetRow = 1
Else
Cells(65536, 1).End(xlUp).Offset(1, 0) = Sheets("Sheet1").Cells(N, 1)
TargetRow = Cells(65536, 1).End(xlUp).Row
End If
Else
TargetRow = Columns(1).Find(Sheets("Sheet1").Cells(N, 1), , xlValues, xlWhole).Row
End If
Cells(TargetRow, 256).End(xlToLeft).Offset(0, 1) = Sheets("Sheet1").Cells(N, 2)
Next N
End Sub
Bookmarks