Menuへ
空白行を削除し詰める



シートコード
コマンドボタンクリックイベント

Private Sub CommandButton1_Click()
    Dim toprow As Long
    Dim bottomrow As Long
    
    '終了する行
    toprow = 8
    '開始する行
    bottomrow = 30
    
    For i = bottomrow To toprow Step -1
        If ActiveSheet.Cells(i, 1) = "" Then
            'A列が空白なら行削除
            Application.Rows(i).Delete
        End If
    Next
End Sub


実行結果
実行前
実行前のシート

実行後、空白が削除され詰められている
実行後のシート



Topへ