用VBA删除EXCEL隐藏行
方法一
Public Sub Deletehide1()
For i = 50000 To 7 Step -1
If Rows(i).Hidden = True Then
Rows(i).Delete
End If
Next i
End Sub
方法二
Public Sub Deletehide2()
Set mrng = ActiveSheet.UsedRange.EntireRow
s = mrng.Rows.Count
For i = s To 1 Step -1
If Rows(i).Hidden = True Or Rows(i).Height < 0.5 Then Rows(i).Delete
Next i
End Sub
方法三
Public Sub Deletehide3()
ActiveSheet.UsedRange.Columns('a').SpecialCells(xlCellTypeVisible).Select
Rows.Hidden = False
Selection.EntireRow.Hidden = True
ActiveSheet.Cells.SpecialCells(12).Delete (3)
Rows.Hidden = False
End Sub
赞 (0)