J
jclark419
Hey everyone, another bit of code here and I want to make sure this is
going to run in the order that I think it will. It consists of a
"nested" for loop. I would like it to run the outer one one time for
every 9 times the inner one runs. In other words I have one for loop
representing the column value and the inner for loop represented the
row value. I want it to perform the calculations for one column at a
time all the way down before it moves to the next. Here is the code:
Code:
--------------------
Public Function results() As Double
Dim answers(9, 9) As Double
Dim i, j, component As intger
For i = 20 To 29
For j = 7 To 15
ThisWorkbook.Worksheets("Calculations").Cells(i, j).Select
component = ThisWorkbook.Worksheets("Calculations").Cells(ActiveCell.row, 6).Value
Select Case component
Case 1
Case 2
Case Else
Next j
Next i
End Function
--------------------
Ignore the select case command I am not too concerned with that right
now, just the for loops.
Thanks.
~Jason
going to run in the order that I think it will. It consists of a
"nested" for loop. I would like it to run the outer one one time for
every 9 times the inner one runs. In other words I have one for loop
representing the column value and the inner for loop represented the
row value. I want it to perform the calculations for one column at a
time all the way down before it moves to the next. Here is the code:
Code:
--------------------
Public Function results() As Double
Dim answers(9, 9) As Double
Dim i, j, component As intger
For i = 20 To 29
For j = 7 To 15
ThisWorkbook.Worksheets("Calculations").Cells(i, j).Select
component = ThisWorkbook.Worksheets("Calculations").Cells(ActiveCell.row, 6).Value
Select Case component
Case 1
Case 2
Case Else
Next j
Next i
End Function
--------------------
Ignore the select case command I am not too concerned with that right
now, just the for loops.
Thanks.
~Jason