Sub Rowcount()
Dim RowStart As Long
Dim RowEnd As Long
RowStart = Cells(1, "B").End(xlDown).Row '-------①表の上から下に行番号を取得
RowEnd = Cells(Rows.Count, "B").End(xlUp).Row '------②表の下から上に取得
MsgBox "B列の先頭行は、" & RowStart & "行です。" & "最終行は、" & RowEnd & "行です"
End Sub
Sub Columncount()
Dim ColumnStart As Long
Dim ColumnEnd As Long
ColumnStart = Cells(6, "A").End(xlToRight).Column '-----①表の左から右へ列番号を取得
ColumnEnd = Cells(6, Columns.Count).End(xlToLeft).Column '-------②表の右から左へ列番号を取得
MsgBox "6行目の先頭列は、" & ColumnStart & "列です。" & "最終列は、" & ColumnEnd & "列です"
End Sub