Klash Ville
Board Regular
- Joined
- Sep 19, 2017
- Messages
- 83
Hello everyone, title says it all. I have a working code but the problem that it's targeting at cell E1 rather than the whole table which is what I want. Any ideas?
Code:
question1 = MsgBox("example message box message", vbQuestion + vbYesNo, "title example...") If question1 = vbYes Then
If Range("E1") = "Item Code Mod" Then
With ActiveSheet.ListObjects("Table1")
.Range.AutoFilter Field:=.ListColumns("Item Code Mod").Index, Criteria1:="=*yes*"
End With
Range("Table1").Select
Selection.EntireRow.Delete
With ActiveSheet.ListObjects("Table1")
.Range.AutoFilter Field:=.ListColumns("Item Code Mod").Index
End With
Else
With ActiveSheet.ListObjects("Table1")
.Range.AutoFilter Field:=.ListColumns("Item Code Modified").Index, Criteria1:="=*yes*"
End With
Range("Table1").Select
Selection.EntireRow.Delete
With ActiveSheet.ListObjects("Table1")
.Range.AutoFilter Field:=.ListColumns("Item Code Modified").Index
End With
End If
End If