Hi all,
I'm struggling with nesting a loop. I have a series of calculations that loops 5 times and offsets a row each time. I then want to repeat this series of loops X amount of times. The code below is only performing the whole task on one row and not the 5 I need.
Dim row As Long
Sub multiple_calc()
Dim theCell As Range
Dim iMyNumber As Integer
Dim iMyNumber2 As Integer
Do
iMyNumber2 = 1 + iMyNumber2
Do
row = row + 1
Set theCell = Sheets("Sheet1").Cells(row + 1, "G")
With theCell
.FormulaR1C1 = theCell.Value + 5
.Calculate
.Offset(0, 1).FormulaR1C1 = theCell.Value + 3
.Calculate
.Offset(0, 2).FormulaR1C1 = theCell.Value + 1
.Calculate
End With
iMyNumber = 1 + iMyNumber
Loop While iMyNumber < 5
row = 1
Loop While iMyNumber2 < 8
End Sub
Bookmarks