here is what i want:
Assume I have 2 ranges of data A and B. B is calculated from a series of calculation included values of range A. I want a loop of 20 times to put B into A and calculate B again. How do I do this?
Thanks in advance
Here is a very simple VBA loop that creates a 20 x 20 matrix. It will help you understand looping with two number ranges.
Sub looptutorial() Dim a As Integer, b As Integer ThisWorkbook.ActiveSheet.Select For b = 1 To 20 For a = 1 To 20 Cells(a, b).Select Selection.FormulaR1C1 = a * b Next a Next b End Sub