Hello Everyone:

I keep getting the error message “Index out of range exception” when I run the following code.


XX Code:
  1. GN3 = (Loops * 5)
  2.  
  3.         For a = 1 To Loops
  4.  
  5.             For b = 1 To GN3
  6.                 R1 = Seeds1(Counter1)
  7.                 Randomize()
  8.                 R2 = CInt(Int((56 * Rnd(R1)) + 1))
  9.                 Counter1 += 1
  10.  
  11.                 MessageBox.Show(R1 & "   " & Counter1 & "   " & b & "   " & GN3)
  12.  
  13.             Next b
  14.         Next a


The message box conforms that the last entry in the array has been reached. And that Counter1 and b both start at 1 and go to 2845. And that GN3 is also 2845 all of the time. What am I doing wrong?

Thanks

Art W.