What does the Excel range.Rows property really do?

前端 未结 9 1845
故里飘歌
故里飘歌 2021-01-30 16:21

OK, I am finishing up an add-on project for a legacy Excel-VBA application, and I have once again run up against the conundrum of the mysterious range.Rows (?) and

9条回答
  •  醉酒成梦
    2021-01-30 16:34

    I've found myself using range.Rows for its effects in the Copy method. It copies the height of the rows from the origin to the destination, which is the behaviour I want.

    rngLastRecord.Rows.Copy Destination:=Sheets("Availability").Range("a" & insertRow)
    

    If I had used rngLastRecord.Copy instead of rngLastRecord.Rows.Copy, the row heights would be whatever was there before the copy.

提交回复
热议问题