FryGirl
Well-known Member
- Joined
- Nov 11, 2008
- Messages
- 1,364
- Office Version
- 365
- 2016
- Platform
- Windows
This code works fine to remove rows from a dataset that contain the values stored in the Array.
In lieu of the Array, can I use a list of data in column A on Sheet2?
With the Array, I will have to change it as soon as another variable is required to be deleted the next time the dataset is refreshed.
In lieu of the Array, can I use a list of data in column A on Sheet2?
With the Array, I will have to change it as soon as another variable is required to be deleted the next time the dataset is refreshed.
Code:
Sub DelRows1()
Application.ScreenUpdating = False
With ActiveSheet.Range("B1", Range("B" & Rows.Count).End(xlUp))
.AutoFilter Field:=1, Criteria1:=Array("AFDZ", "ANA", "FMS", "N/A", "SOF","BCXX), Operator:=xlFilterValues
.Offset(1).EntireRow.Delete
.AutoFilter
End With
Application.ScreenUpdating = True
End Sub