用公式可以实现,但比较麻烦,给你一段vba代码,在工作表名称上右键,查看代码,把下面代码贴进去,运行就可以了。
Sub cf()
h = Range("A1").End(xlDown).Row
Rows("1:1").Copy
hn = h + 5
Cells(hn, 1).Select
ActiveSheet.Paste
For i = 2 To h
k = Cells(i, 2)
For j = 1 To k
hn = hn + 1
Cells(hn, 1) = Cells(i, 1)
Cells(hn, 2) = 1
Next j
Next i
End Sub