Hello All,
I'm working on a problem where I'm iterating through possible combinations of components, I have a sheet that has in Col(F) the Min, Col(G) the Max, and Col(H) the steps; similar to how a For Min to Max step Steps function would work.
I've recorded all of these values by
Dim Min(1 To 100) As Double
Dim Max(1 To 100) As Double
Dim Step(1 To 100) As Double
and reading from the sheet into the min, max, and step variables.
So here's the problem, in Col(A) I have the Machine Name so I need a nested for loop for all of the components of that machine (which could be anywhere from 1 to 10 (but possibly more in the future) components. Then my macro moves to the next machine name, grabs the min, max, and steps variables for that machine's components and I need it to again create and preform a nested for loop for that machines components.
I've written the Master For Loop that moves from one machine to the next and saves the min, max, and step; I save those variables as Min(RowNumber), Max(RowNumber), Step(RowNumber)
for every iteration I need the nested for loop value printed to Col(I) the '# of Components' column and the sheet preforms basic calculations in formulas to determine the efficacy of that combination. My macro saves the 'optimal solution' and then prints it out for all of those components before moving on to the next machine.
I've never used recursive functions so if an answer includes that functionality please write with that in mind. I've searched and studied but haven't been able to understand how to manipulate their functionality.
Thank you in advance for your help!!!!
Cheers,
-Evan
I'm working on a problem where I'm iterating through possible combinations of components, I have a sheet that has in Col(F) the Min, Col(G) the Max, and Col(H) the steps; similar to how a For Min to Max step Steps function would work.
I've recorded all of these values by
Dim Min(1 To 100) As Double
Dim Max(1 To 100) As Double
Dim Step(1 To 100) As Double
and reading from the sheet into the min, max, and step variables.
So here's the problem, in Col(A) I have the Machine Name so I need a nested for loop for all of the components of that machine (which could be anywhere from 1 to 10 (but possibly more in the future) components. Then my macro moves to the next machine name, grabs the min, max, and steps variables for that machine's components and I need it to again create and preform a nested for loop for that machines components.
I've written the Master For Loop that moves from one machine to the next and saves the min, max, and step; I save those variables as Min(RowNumber), Max(RowNumber), Step(RowNumber)
for every iteration I need the nested for loop value printed to Col(I) the '# of Components' column and the sheet preforms basic calculations in formulas to determine the efficacy of that combination. My macro saves the 'optimal solution' and then prints it out for all of those components before moving on to the next machine.
I've never used recursive functions so if an answer includes that functionality please write with that in mind. I've searched and studied but haven't been able to understand how to manipulate their functionality.
Thank you in advance for your help!!!!
Cheers,
-Evan