I am dealing with a chang开发者_运维技巧ing file and I would like to copy the last 10 rows of a certain column and then paste it into another worksheet, the original worksheet gets updated throughout the day.
Const COLUMN_INDEX = 1 ' Desired column
Sub CopyValues()
Dim LastRow = [A65536].End(xlUp).Row ' Find the last row index
Dim I
For I = LastRow - 10 To LastRow
'Do something with Cells(I, COLUMN_INDEX).Value
Next I
End Sub
精彩评论