Delete cells in an Excel column when rows = 0

前端 未结 4 1914
有刺的猬
有刺的猬 2020-11-28 16:19

I am trying to delete all cells =0 in a column in my spreadsheet and \"summon\" the values which don\'t to the top of the column.

I am currently using



        
4条回答
  •  小蘑菇
    小蘑菇 (楼主)
    2020-11-28 16:48

    Autofilter solution

    Dim rng1 As Range
    Set rng1 = Range([p7], Cells(Rows.Count, "p").End(xlUp))
    ActiveSheet.AutoFilterMode = False
    With rng1
    .AutoFilter Field:=1, Criteria1:="0"
    .Delete xlUp
    End With
    

提交回复
热议问题