I've done a little bit of digging and haven't found any solutions that come close to what I am looking for.
The idea is that I will have 3 list boxes. The first labeled lstF1, the second labeled lstF2, the third labeled lstResult.
What I want to do is take a value from the first list and then with that value perform some arithmetic against *each* of the values in lstF2 and post the results in the lstresult. Then move to the second item in lstF1 and do the whole thing again.
I haven't declared variable types yet because I think that the arrays from the list boxes are pulled in as strings and I would prefer them to be integers. I will work through that later.
So far this is what I have.
Code:'' inside of a command button Dim f1 Dim f2 Dim item() Dim items() Dim IM3a Dim IM3b Dim IM3c Dim IM3d 'Read through list'''''''''''''''''''''''''''''''''''''' For i = 0 To lstF1.ListCount - 1 ReDim Preserve item(i) item(i) = lstF1.List(i) f1 = item(i) 'Start nested loop' For x = 0 To lstf2count - 1 ReDim Preserve items(x) items(x) = lstF2.List(x) f2 = items(x) IM3a = 2 * f1 + f2 IM3b = 2 * f1 - f2 IM3c = 2 * f2 + f1 IM3d = 2 * f2 - f1 With lstResult .AddItem IM3a .AddItem IM3b .AddItem IM3c .AddItem IM3d End With Next'' should be next items(x) Next'' should be next items(i) End Sub
What I am seeing is that I never seem to enter the nested loop. If I put a break inside of the nested loop I never enter it.
Any help would be much appreciated.




Reply With Quote
