在上次使用的行之后插入数据

**问题:**我需要在工作表中最后使用的行之后插入数据。 我能够find最后使用的行与下面的代码。

ActiveSheet.Cells.(Rows.count, "D").End(xlUp).row 

现在我要在最后使用的行旁边插入数据。

首先定义lastrow作为variables。 什么.row做的是返回一个数字表示行,在这种情况下,最后一行。 +1将其向下移动1个单元格。

 Dim lastrow as Long lastrow = Activesheet.Cells(Rows.Count, "D").End(xlUp).row + 1 Activesheet.Cells(lastrow, "D").Value = "Your Value here"