vba-获取某一个sheet某一列最大行
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