Sub 删除A列等于指定内容的行() Dim a As Range endrow = Range("A65536").End(xlUp).Row For Each a In Range("A1:A" & endrow) If a = "指定内容" Then a.EntireRow.Delete End If Next End Sub追问
A列中有"指定内容"的单元格所在行会被删除,供参考: Private Sub CommandButton1_Click() i = 1 Do Until Cells(i, 1) = "" If Cells(i, 1) = "指定内容" Then Cells(i, 1).Delete i = i - 1 End If i = i + 1 Loop End Sub追问