Loop through all used range : UsedRange « Access « VBA / Excel / Access / Word






Loop through all used range

 

Sub ResetTest4()
    For Each n In ActiveSheet.UsedRange
        If n.Value <> 0 Then
            n.Value = 0
        End If
    Next n
End Sub

 








Related examples in the same category

1.Working with the Used Range
2.Remove extraneous rows and columns and reset the last cell
3.Using the SpecialCells method to select all the blanks in this range is one way to quickly fill in all the blank region cells with the region found above them:
4.Using the Areas Collection to Return a Noncontiguous Range