dboatswain
New Member
- Joined
- Dec 18, 2016
- Messages
- 3
Hi everyone,
In the past I have used the formula below to delete rows based on particular values.
Sub Two()
Application.ScreenUpdating = False
With Sheets("Indigenous_Hours_Program").Range("F1", Range("F" & Rows.Count).End(xlUp))
.AutoFilter Field:=1, Criteria1:=Array("6346", "6331", "4365", "6150", "2199", "2199", "4251", "6083", "6122", "2406", "2017", "2012", "2094", "2099", "2117", "5141", "5041"), Operator:=xlFilterValues
.Offset(1).EntireRow.Delete
.AutoFilter
End With
Application.ScreenUpdating = True
End Sub
However I have been given a large report (2000+ lines), where I need to exclude (delete) employees (400+) based on employee number (we have no other defining attribute unfortunately, it's an external report).
I have tried updating the above formula with employee numbers, however I get errors on stacking and syntax ...
I hope someone can please help me!
Oh and I have no idea how to code, very basic understanding
In the past I have used the formula below to delete rows based on particular values.
Sub Two()
Application.ScreenUpdating = False
With Sheets("Indigenous_Hours_Program").Range("F1", Range("F" & Rows.Count).End(xlUp))
.AutoFilter Field:=1, Criteria1:=Array("6346", "6331", "4365", "6150", "2199", "2199", "4251", "6083", "6122", "2406", "2017", "2012", "2094", "2099", "2117", "5141", "5041"), Operator:=xlFilterValues
.Offset(1).EntireRow.Delete
.AutoFilter
End With
Application.ScreenUpdating = True
End Sub
However I have been given a large report (2000+ lines), where I need to exclude (delete) employees (400+) based on employee number (we have no other defining attribute unfortunately, it's an external report).
I have tried updating the above formula with employee numbers, however I get errors on stacking and syntax ...
I hope someone can please help me!
Oh and I have no idea how to code, very basic understanding