Hi,

I am a novice at this and would appreciate any help.
I get a Compile Error: Next without For message even though I do have a For. Here's the script:

Dim myOscArray(10, 3) As Single
Dim mySumflow As Single
Dim myMeanflow As Single
mySumflow = 0
j = 0
Set currentCell = Range("I11")
For i = 1 To myDatasecs - 2
Set nextCell = currentCell.Offset(1, 0)
Set currentCell = nextCell
mySumflow = mySumflow + currentCell.Offset(0, -2).Value
If j = 11 Then
myMeanflow = mySumflow / i
Exit For
Else
If currentCell.Formula <> "" Then
myOscArray(j, 1) = currentCell.Value
Else
If currentCell.Offset(0, 1).Value <> "" Then
myOscArray(j, 2) = currentCell.Value
j = j + 1
Else
Next i

Thanks,
Neil