Sub bJoin()
Dim sArr(), cRow As Long, lRow As Long
If MsgBox("Co muon chay khong?", vbOKCancel) = 2 Then Exit Sub
If TypeName(Selection) <> "Range" Then Exit Sub
lRow = Selection.Row
cRow = Selection.Rows.Count
sArr() = Range(Cells(lRow, 1), Cells(lRow + cRow - 1, 3)).Value
lRow = Application.Sum(Range(Cells(lRow, 3), Cells(lRow + cRow - 1, 3)))
If lRow = 0 Then Exit Sub
Columns(8).Clear
Range("H1").Resize(lRow) = fJoin(sArr, lRow)
End Sub
Private Function fJoin(sArr As Variant, lRow As Long) As Variant
Dim dArr(), i As Long, j As Long, k As Long
ReDim dArr(1 To lRow, 1 To 1)
For i = 1 To UBound(sArr)
For j = 1 To sArr(i, 3)
k = k + 1
dArr(k, 1) = sArr(i, 1) & Format(j, "00")
Next j
Next i
fJoin = dArr
End Function