Public Function End_Col(rag As Range) As Integer'自定义函数获取最后非空单元格的行序-
'ActiveCell.Row-
Dim aa As Integer-
-
For Each temp In rag-
If temp.Value <> "" Then-
aa = temp.Row'获取行序-
'aa=temp.column'获取列序-
End If-
Next temp-
End_Col = aa-
End Function-
-
示例:-
只有B23非空,则End_Col(A2:B100)=23-