Function getLastRow(ByVal sheetName As Worksheet, ByVal columnName As String) As Long Dim maxRow As Long If Right(rptfile, 3) = "xls" Then maxRow = sheetName.[A65536].End(xlUp).Row Else maxRow = sheetName.[A1048576].End(xlUp).Row End If getLastRow = maxRow End Function
标签:Function,vba,End,ByVal,Long,maxRow,sheetName,一列,sheet From: https://www.cnblogs.com/Insist-Y/p/16950256.html