0

少しデータの前処理をしようとしています。空のセルを含む行を削除するマクロを作成したいと考えています。

私はインターネットで助けを求めていましたが、彼らは私をどこにも連れてこなかったか、コードを完全に理解できませんでした

Sub ListWiseDel()


Dim cell As Range

For Each cell In Range("A1:U1077")
If IsEmpty(c.Value) Then
ActiveCell.EntireRow.Delete

End If
Next cell

End Sub

私はこれを試してきましたが、エラーが発生し続けます。

4

1 に答える 1

1

これを試して :

Sub delEmptyRow()

    Dim col, ligne
    Dim vide

    ligne = 10
    While ligne > 0
        vide = False
        col = 1
        Do While Not vide And col <= 10
            If IsEmpty(Cells(ligne, col)) Then
                vide = True
            End If
            col = col + 1
        Loop
        If vide Then Cells(ligne, 1).EntireRow.Delete
        ligne = ligne - 1
    Wend
End Sub
于 2013-05-03T16:13:19.983 に答える