First up, why would you be calculating the mean inside a loop? The mean is just one value, right? So why would you calculate it more than once?

Also, you say one thing:
mean = sum/N
yet you do something else:
Code:
Mean = CInt(Sum / (MyArray.Count - 1))
You're making the same two errors with your std dev as well.