!!!Excel VBA 最後のセルを取得する [Excel VBA] !!Excel ワークシート上の最終セルに移動する *Ctrl + End で最後のセルに移動する *一旦Endキーを押して、Homeキーを押す !!Excel ワークシート上の最終セルをVBAから取得する !シート全体 'A1から、Ctrl + End で取得できるセル Dim sheet As Worksheet Dim endCel As Range Set sheet = ActiveSheet Set endCel = sheet.Range("A1").SpecialCells(xlLastCell) Debug.Print endCel.Row & "," & endCel.Column !列ごと '1列目の最下行からCtrl + ↑ で取得できる行 Dim targetCol as Integer targetCol = 1 Set sheet = ActiveSheet sheet.Cells(Rows.Count,targetCol).End(xlUp).Row !!データを削除しても、最終セル位置が元に戻らない場合 *一旦、上書き保存を行う。 ---- {{include_html banner_html, "!Excel"}}