Row count where data exists

前端 未结 7 1641
广开言路
广开言路 2021-02-08 19:24

I need to count the total number of rows that have data. I want to be able to use this on multiple sheets with different amounts of data rows.

I cannot figure out gener

7条回答
  •  [愿得一人]
    2021-02-08 19:38

    I've implemented it like this:

    Public Function LastRowWithData(ByVal strCol As String, ByVal intRow As Integer) As Long
        Range(strCol & intRow).Select
        LastRowWithData= ActiveSheet.Cells(ActiveSheet.Rows.Count, strCol).End(xlUp).Row
    End Function
    

提交回复
热议问题