Hi All
I am generating certain number for a table. I am trying to write a vba code for numbers to be added row wise and column wise.
I am unable to move the second row to add the values in column "O". Below is the code, can u tell me how to move to the next row
so that sum is generated .
Private Sub Command Button1_Click()
Dim ab1 As Range
Dim AB2 As Range
Dim ab3 As Long
Dim ab4 As Long
Dim AB5 As Long
Dim AB6 As Range
'Random numbers
For Each ab1 In Range("c2:n27")
ab1.Offset(0, 0).Value = Application.WorksheetFunction.RandBetween(325, 956)
Next ab1
'Adding Values
For Each AB2 In Range("o2:o27")
AB2.Offset(0, 0).Value = Application.WorksheetFunction.Sum(Range("C2: N2")) 'From this point how will i move to the next row c3:n3 ???
Next AB2
End Sub
Many thanx in advance
Bookmarks