mingandmong
Active Member
- Joined
- Oct 15, 2014
- Messages
- 339
HI I'm using excel 2016
the following macro deletes all the rows of data when the word "SHOP" is found in column c
the issue I have is if the word "SHOP" is not found than all the data is removed except just one row
how can I change this
Sub Macro2()
Application.ScreenUpdating = False
With Range("C1", Range("C" & Rows.Count).End(xlUp))
.AutoFilter Field:=1, Criteria1:=Array("SHOP"), Operator:=xlFilterValues
.Offset(1).Resize(.Rows.Count - 1).EntireRow.Delete
.AutoFilter
End With
Application.ScreenUpdating = True
End Sub
the following macro deletes all the rows of data when the word "SHOP" is found in column c
the issue I have is if the word "SHOP" is not found than all the data is removed except just one row
how can I change this
Sub Macro2()
Application.ScreenUpdating = False
With Range("C1", Range("C" & Rows.Count).End(xlUp))
.AutoFilter Field:=1, Criteria1:=Array("SHOP"), Operator:=xlFilterValues
.Offset(1).Resize(.Rows.Count - 1).EntireRow.Delete
.AutoFilter
End With
Application.ScreenUpdating = True
End Sub