Sub a()
LR = Cells(Rows.Count, "A").End(xlUp).Row
num = Cells(1, 1).Value
lang = Cells(1, 2).Value
destrow = 1
icol = 4: col = icol + 1
Cells(destrow, icol).Value = num
Cells(destrow, col).Value = lang
For j = 2 To LR
If num = Cells(j, 1).Value Then
col = col + 1
If col > 9 Then Exit For
Cells(destrow, col).Value = Cells(j, 2).Value
Else
num = Cells(j, 1).Value
destrow = destrow + 1
icol = 4: col = icol + 1
Cells(destrow, icol).Value = Cells(j, 1).Value
Cells(destrow, col).Value = Cells(j, 2).Value
End If
Next
End Sub |