I have this simple function in Excel VBA.

```
Public Function ubi() As Integer
Dim i As Integer
For i = 7 To 10
If IsNumeric(Cells(35, i).Value) Then
ubi = i
End If
Next
ubi = i
End Function
```

As you see, the values of `i`

are supposed to be `7`

or `8`

or `9`

or `10`

. But, when I test the function in the Excel Worksheet I find `ubi()=11`

.

So, What could be the source of error in my code ?