Littleme
New Member
Hi everyone!
Am new to this forum and am really hoping you can help me... this seemingly simple problem has got me totally stumped.
What I want to do is delete entire rows in the Table called "Databas" if cell in column "I" is empty. That's it. Copied code from ron de bruin but keep getting run time error 1004.
Driving me crazy!
Very grateful if someone could take a look at the file and help... maybe I'll be able to sleep =)
Am new to this forum and am really hoping you can help me... this seemingly simple problem has got me totally stumped.
What I want to do is delete entire rows in the Table called "Databas" if cell in column "I" is empty. That's it. Copied code from ron de bruin but keep getting run time error 1004.
Driving me crazy!
Very grateful if someone could take a look at the file and help... maybe I'll be able to sleep =)
Code:
Sub Delete_with_Autofilter()
Dim DeleteValue As String
Dim rng As Range
Dim calcmode As Long
With Application
calcmode = .Calculation
.Calculation = xlCalculationManual
.ScreenUpdating = False
End With
'Fill in the value that you want to delete
'Tip: use DeleteValue = "<>ron" to delete rows without ron
DeleteValue = ""
'Sheet with the data, you can also use Sheets("MySheet")
With ActiveSheet
'Firstly, remove the AutoFilter
.AutoFilterMode = False
'Apply the filter
.Range("A1:k" & .Rows.Count).AutoFilter Field:=9, Criteria1:=DeleteValue
With .AutoFilter.Range
On Error Resume Next
Set rng = .Offset(1, 0).Resize(.Rows.Count - 1, 1) _
.SpecialCells(xlCellTypeVisible)
On Error GoTo 0
If Not rng Is Nothing Then rng.EntireRow.Delete
End With
'Remove the AutoFilter
.AutoFilterMode = False
End With
With Application
.ScreenUpdating = True
.Calculation = calcmode
End With
End Sub