
Sub Init()
Range("A1").Value = "Names"
Range("A2").Value = "Petter"
Range("A3").Value = "Peter"
Range("A4").Value = "Peter2"
Range("A5").Value = "Petter3"
Range("A6").Value = "Petter4"
Range("B1").Value = "Values"
Range("B2").Value = 1
Range("B3").Value = 2
Range("B4").Value = 0
Range("B5").Value = 3
Range("B6").Value = 0
End Sub
Sub Delete_Values_If_0()
Dim lastRow As Long
Range("A1").CurrentRegion.AutoFilter Field:=2, Criteria1:=0
lastRow = Range("A1").CurrentRegion.SpecialCells(xlCellTypeLastCell).Row
Debug.Print lastRow
Range("2:" & lastRow).Delete
Range("A1").CurrentRegion.AutoFilter
End Sub
Sub Hide_Values_If_0()
Range("A1").CurrentRegion.AutoFilter Field:=2, Criteria1:="<>0", Operator:=xlAnd
End Sub
Sub FilterOff()
If ActiveSheet.AutoFilterMode Then
ActiveSheet.AutoFilterMode = False
End If
End Sub