LoginSignup
2
1

More than 3 years have passed since last update.

最終行の検索

Last updated at Posted at 2019-08-06

エクセルで最終行を検索する際に用いるマクロ

方法1
MaxRow = Range("A65536").End(xlUp).Row
MaxCol = Range("IV1").End(xlToLeft).Column ' IV1=256列

問題点:バージョンによって最終行の位置が変わるため汎用的でない

方法2⇦最も一般的
MaxRow = Cells(Rows.Count, 1).End(xlUp).Row
MaxCol = Cells(1, Columns.Count).End(xlToLeft).Column

参考: http://officetanaka.net/excel/vba/tips/tips130.htm

2
1
1

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
2
1