I have the following code in my Excel sheet:
Sub DeleteRows
'Filter CMReport to delete (Blank) rows.
With ActiveSheet
.AutoFilterMode = False
.Range("A1:G1").AutoFilter
.Range("A1:G1").AutoFilter Field:=1, Criteria1:="="
.Range("A1:G1").Offset(1, 0).SpecialCells(xlCellTypeVisible).EntireRow.Delete
End With
End Sub
It will filter the blank rows but will not delete them... it says that no rows are selected. What am I doing wrong.
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…