Mega Code Archive

 
Categories / VisualBasic Script / Excel
 

Checks values in a range 10 rows by 5 columns

Sub CheckValues1()     Dim rwIndex As Integer     Dim colIndex As Integer     For rwIndex = 1 To 10             For colIndex = 1 To 5                 If Cells(rwIndex, colIndex).Value <> 0 Then _                     Cells(rwIndex, colIndex).Value = 0             Next colIndex     Next rwIndex End Sub