Mega Code Archive

 
Categories / VisualBasic Script / Excel
 

The Cells property is best suited for use with loops because it accepts numerical parameters representing the row and column indices

Sub cellPro()     Dim I As Integer     Dim K As Integer     For K = 1 To 5         For I = 1 To 10             Cells(I, K).Value = I * K         Next I     Next K End Sub