Visual Basic For Applications Tips


最大行数と最大列数の取得


ワークシート上の最大行数と最大列数を取得します。


MsgBox "ワークシートの最大行数は" & ActiveSheet.Cells.CurrentRegion.Rows.Count
MsgBox "ワークシートの最大列数は" & ActiveSheet.Cells.CurrentRegion.Columns.Count