Function getlastcell(mysheet As String, Optional startrow As Integer) As Integer
Sheets(mysheet).Select
rowcountinu = False
If startrow = 0 Then
startrow = 2
End If
For i = startrow To startrow + 2000
If Trim(Cells(i, 1).Text) = "" Then
getlastcell = i
rowcountinu = False
Exit Function
End If
Next
rowcountinu = True
getlastcell = i - 1 '临时方法,用2000作为分界和首次未结束标记
End Function
Sheets(mysheet).Select
rowcountinu = False
If startrow = 0 Then
startrow = 2
End If
For i = startrow To startrow + 2000
If Trim(Cells(i, 1).Text) = "" Then
getlastcell = i
rowcountinu = False
Exit Function
End If
Next
rowcountinu = True
getlastcell = i - 1 '临时方法,用2000作为分界和首次未结束标记
End Function