如何在Excel中每个有数据的行之后插入一个特定的值?

我试图在Excel中使用macros的每个数据行之后的新行中插入一个特定的值。 我在网上find了下面的脚本,但是这个脚本只插入了一个空行。 我需要在每个数据行之后插入一个值为hello的新行。

 Sub addrowwithvalue() m = Range("a1").CurrentRegion.Rows.Count For i = m To 2 Step -1 Cells(i, 1).EntireRow.insert Next End Sub 

预期产出:

 row1 hello row2 hello row3 hello 

尝试在Next之前立即插入行Cells(i, 1).Value = "hello"

m改为第3行中的m + 1作为最后的“hello”。

怎么样:

 Sub addrowwithvalue() m = Range("a1").CurrentRegion.Rows.Count For i = m To 2 Step -1 Cells(i, 1).EntireRow.Insert Next Dim r As Range Set r = Intersect(ActiveSheet.UsedRange, Range("A:A").Cells.SpecialCells(xlCellTypeBlanks)) r.Value = "Hello" End Sub