基本 その3



データ数


Sub dCount()
    Dim rCnt, cCnt As Integer
    
    rCnt = Range("A1").EntireColumn.SpecialCells(xlCellTypeConstants).Count
    cCnt = Range("A1").EntireRow.SpecialCells(xlCellTypeConstants).Count
    
    rCnt = Cell(1, 1).EntireColumn.SpecialCells(xlCellTypeConstants).Count
    cCnt = Cell(1, 1).EntireRow.SpecialCells(xlCellTypeConstants).Count
    
    MsgBox "A列のデータ件数は" & rCnt & "件で、1行目のデータ数は" & cCnt & "件です"
End Sub