Romano_odK
Active Member
- Joined
- Jun 4, 2020
- Messages
- 380
- Office Version
- 365
- Platform
- Windows
Good morning,
I recieved this code last week and it works great. Now I would like it to also filter empty cells. Can this be done?
Thank you for your time.
I recieved this code last week and it works great. Now I would like it to also filter empty cells. Can this be done?
Thank you for your time.
VBA Code:
Private Sub FilterOK_Click()
Dim tbl As ListObject
Dim col As ListColumn
Dim fnd As Range
Set tbl = ActiveSheet.ListObjects("ItemsImport")
Set col = tbl.ListColumns("Afwijking%" & Chr(10) & "opslag")
Set fnd = col.Range.Find("ok", , xlValues, xlWhole, , , False)
Application.ScreenUpdating = False
If Not fnd Is Nothing Then
tbl.Range.AutoFilter col.Index, "ok"
tbl.DataBodyRange.EntireRow.Delete
ActiveSheet.ShowAllData
End If
Application.ScreenUpdating = True
End Sub