0

I am hoping someone would help with this query. I have a spreadsheet that I get daily at work.

I am looking to delete every row on excel that does not contain certain values in col A.

VBA does not let me run the below code and I cannot work out why. Could someone help?

Rows("1:1").Select
Selection.AutoFilter
ActiveSheet.Range("$A$1:$AR$3403").AutoFilter Field:=1, _
Criteria1:=Array("<>SKTRUSDBND", "<>1628", "<>1565", "<>OMSPSF"), 
Operator:=xlFilterValues
Rows("2:1545").Select
Selection.Delete Shift:=xlUp
Rows("1:1").Select
Selection.AutoFilter
BigBen
  • 46,229
  • 7
  • 24
  • 40
  • It seems that your line `Criteria1:=Array("<>SKTRUSDBND", "<>1628", "<>1565", "<>OMSPSF"),` has to be `Criteria1:=Array("<>SKTRUSDBND", "<>1628", "<>1565", "<>OMSPSF"), _` ? – karma May 04 '20 at 15:43
  • https://stackoverflow.com/questions/28575754/filter-out-multiple-criteria-using-excel-vba - you need a different approach. – BigBen May 04 '20 at 15:44
  • if i wrote the code out a few times and instead of using the array functionality and use the call functionality. I believe it might work. Will let you guys know – Kenny720 May 05 '20 at 07:18

0 Answers0