Loop through all cells in a range : Range Loop « Excel « VBA / Excel / Access / Word






Loop through all cells in a range

 
Sub ResetTest1()
    For Each n In Range("A1:A13")     '   Substitute your range here
        If n.Value <> 0 Then
            n.Value = 0
        End If
    Next n
End Sub

 








Related examples in the same category

1.For Each Loops for a range
2.Loop through a range cell by cell
3.Set the value in a range by cell index
4.Get Rows from a range
5.Get rows from a named range (name the range before running this cript)