查找最后一列,然后查找该列中的最后一行
Finding last column and then finding the last row in that column
我需要找到作品中的最后一列sheet,然后找到该特定列中的最后一行。对于最后一列,我使用的是:
lastcol = .Cells(1, .Columns.count).End(xlToLeft).Column
last_row = Range((Cells(Rows.count), lastcol).Find("*", after:=r, LookIn:=x1values, lookat:=x1part, SearchOrder:=xlByColumns, SearchDirection:=xlPrevious, MatchCase:=False)
Here是作品快照sheet:
有人能帮我把我想保存的所有数据放在二维数组中,然后将数据粘贴到 Excel sheet 上吗?
方法如下:
lastcol = .Cells(1, .Columns.Count).End(xlToLeft).Column
lastrow = .Cells(.Rows.Count, lastcol).End(xlUp).Row
.Cells(lastrow + 1, lastcol).Resize(UBound(myarray)) = myarray
.
假设批处理数据来源于 Sheet1 中的 A1 单元格,下面是如何制作二维数组:
Dim myarray
myarray = Sheet1.[a1].CurrentRegion
我需要找到作品中的最后一列sheet,然后找到该特定列中的最后一行。对于最后一列,我使用的是:
lastcol = .Cells(1, .Columns.count).End(xlToLeft).Column
last_row = Range((Cells(Rows.count), lastcol).Find("*", after:=r, LookIn:=x1values, lookat:=x1part, SearchOrder:=xlByColumns, SearchDirection:=xlPrevious, MatchCase:=False)
Here是作品快照sheet:
有人能帮我把我想保存的所有数据放在二维数组中,然后将数据粘贴到 Excel sheet 上吗?
方法如下:
lastcol = .Cells(1, .Columns.Count).End(xlToLeft).Column
lastrow = .Cells(.Rows.Count, lastcol).End(xlUp).Row
.Cells(lastrow + 1, lastcol).Resize(UBound(myarray)) = myarray
.
假设批处理数据来源于 Sheet1 中的 A1 单元格,下面是如何制作二维数组:
Dim myarray
myarray = Sheet1.[a1].CurrentRegion