Delete entire row if cell contains the string X

前端 未结 7 1300
感情败类
感情败类 2020-12-08 07:07

I am new to VBA and I am trying to come up with a way to delete all rows (and shift cells up, if possible) where the website column cell contains the word none.

7条回答
  •  佛祖请我去吃肉
    2020-12-08 07:21

    Try this ...

    Dim r as Range
    Dim x as Integer
    
    For x = 5000 to 4 step -1 '---> or change as you want //Thanx 4 KazJaw
    
      set r = range("E" & format(x))
      if ucase(r.Value) = "NONE" then
        Rows(x).EntireRow.Delete
      end if 
    
    Next
    

提交回复
热议问题