I have macro.In this it only remove data not rows. For example, if I have 600,000 records and after the macro runs I am left with 15000 records.but In my excel sheet is still showing 600,000 records: 15000 records with data and rest empty. I want it show only 15000 records.All empty row should be deleted. Here is my code:
Sub DeleteRecord()
Dim MySheet As String
Dim cnt As Long
MySheet = ActiveSheet.Name
Cells(1, 1).CurrentRegion.AutoFilter Field:=33, Criteria1:= _
">=-.09", Operator:=xlAnd, Criteria2:="<=.01"
cnt = Worksheets(MySheet).Cells.SpecialCells(xlCellTypeLastCell).Row
If cnt > 3 Then Range("A2", ActiveCell.SpecialCells(xlLastCell)).Select
Selection.EntireRow.Delete
End If
Cells(1, 1).CurrentRegion.AutoFilter Field:=33
End Sub