Mega Code Archive

 
Categories / VisualBasic Script / Language Basics
 

Checks values in a range 10 rows by 5 columns

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