Sub gopdulieu()
Dim tam As String
Dim dongbatdau As Long
Dim i As Long
Dim j As Long
Dim c As Long
Do
dongbatdau = InputBox(" Hay nhap so dong bat dau")
Loop Until dongbatdau >= 1 And dongbatdau <= Sheets("NK").Range("B" & Rows.Count).End(xlUp).Row
For i = dongbatdau To Sheets("NK").Range("B" & Rows.Count).End(xlUp).Row
c = 0
For j = i + 1 To Sheets("NK").Range("B" & Rows.Count).End(xlUp).Row
If Range("A" & j).Value = Range("A" & i) Or Range("A" & j).Value = "" Then
c = c + 1
Else
GoTo TIEP
End If
Next j
TIEP:
If c = 0 Then GoTo BOQUA
tam = "'- " & Trim(Range("B" & i).Value)
For j = i + 1 To i + c
If Range("B" & i).Value <> "" Then
tam = tam & Chr(10) & "- " & Trim(Range("B" & j).Value)
End If
Next j
For j = i + c To i + 1 Step -1
Rows(j).Delete
Next j
Range("b" & i).Value = tam
BOQUA:
If i = Sheets("NK").Range("B" & Rows.Count).End(xlUp).Row Then Exit Sub
Next i
End Sub