CountA()
를 사용하지 않고 다른 버전을 발견하는 기능입니다 필요 통과 열
에 데이터가없는 경우
0
을 반환
Function firstrow2(col As Range) As Long
Dim f As Range
Set f = col.Find("*", after:=col.Cells(col.Parent.Rows.Count)) '<--| look for any value in given column from its row 1 (included) downwards
If Not f Is Nothing Then firstrow2 = f.Row '<--| if found then return its row index
End Function
당신은 다음을 사용할 수 있습니다 조금 더 강력하게하고 잘못된 통과 범위 (열 후가 아닌 전체 열 또는 넓은)를 처리해야합니다
Function FirstRow(col As Range) As Long
Dim f As Range
With col.Columns(1).EntireColumn
Set f = .Find("*", after:=.Cells(.Rows.Count)) '<--| look for any value from row 1 (included)
End With
If Not f Is Nothing Then FirstRow4 = f.Row '<--| if found then return its row index
End Function
'firstRowIndex = .Cells (1, "A"). 끝 (xlDown) .row' 및 가능한 행 처리 –