批量删除
Excel怎样批量自动删除行(空格)
用三、数据区域空格删除整行宏代码修改如下
"Sheet2"改为你黄色表名可以在白色表运行宏可以
Sub 删除整行()
'2020-5-27 22:10:31
Dim myr As Range, i As Long, myc As Range, myn As Range, r As Long
Set myr = Range("d3:d" & Range("d" & Rows.Count).End(xlUp).Row)
r = ActiveWorkbook.Sheets("Sheet2").Range("C" & Rows.Count).End(xlUp).Row
Set myc = ActiveWorkbook.Sheets("Sheet2").Range("c3:c" & r)
Application.ScreenUpdating = False
For i = myr.Count To 1 Step -1
For Each myn In myc
If myr.Cells(i).Value = myn.Value Then
Rows(myr.Cells(i).Row).Delete Shift:=xlUp
End If
Next myn
Next i
Application.ScreenUpdating = True
End Sub
具体函数如何输入,我找了很多方法,奈何过菜,望教操作