要在包含Excel工作表中数据的最后一行中使用宏,请按照以下步骤操作:
Function LastRowInSheet(ws As Worksheet, columnToCheck As Integer)
Dim lastRow As Long
lastRow = ws.Cells(ws.Rows.Count, columnToCheck).End(xlUp).Row
LastRowInSheet = lastRow
End Function
这样,您就可以使用宏找到包含Excel工作表中数据的最后一行了。
领取专属 10元无门槛券
手把手带您无忧上云