use*_*607 1 excel vba excel-vba
我试图在使用宏在Excel中具有数据的每一行之后的新行中插入特定值.我在网上找到了以下脚本,但是这个脚本只插入一个空行.我需要hello在每个数据行之后插入一个带有值的新行.
Sub addrowwithvalue()
m = Range("a1").CurrentRegion.Rows.Count
For i = m To 2 Step -1
Cells(i, 1).EntireRow.insert
Next
End Sub
Run Code Online (Sandbox Code Playgroud)
预期产量:
row1
hello
row2
hello
row3
hello
Run Code Online (Sandbox Code Playgroud)