Attribute VB_Name = "Modul5" Option Explicit ' ' leere Zeilen löschen ' Abbruch wenn letzte gefüllte Zeile erreicht ' Sub Delleer() Dim zeile As Integer Dim spalte As Integer Dim last_row As Integer Dim last_column As Integer Dim anz_del As Integer Dim kz_loe As String ' ' Tabellenblatt öffnen Sheets("Tabelle1").Select ' Tabellengrösse ermitteln ActiveSheet.Cells.SpecialCells(xlCellTypeLastCell).Activate last_row = ActiveCell.Row last_column = ActiveCell.Column 'Parameter füllen anz_del = 0 zeile = 1 While zeile <= last_row 'Prüfen ob alle Zellen leer sind spalte = 1 kz_loe = "DEL" While spalte <= last_column And kz_loe <> "" If Trim(Cells(zeile, spalte)) <> "" Then kz_loe = "" End If spalte = spalte + 1 Wend ' löschen wenn notwendig If kz_loe = "DEL" Then MsgBox "Löschen Zeile : " & Str(zeile + anz_del) Rows(zeile).Select Selection.Delete shift:=xlUp 'Tabellenhöhe reduziert sich last_row = last_row - 1 anz_del = anz_del + 1 Else zeile = zeile + 1 End If Wend MsgBox ("Löschen beeendet") End Sub