I am trying to run Rungenkutta differential problem in excel VBA program is as follows
Sub Rungenkutta()
Dim Noofitrations As Integer
Dim n As Integer
Dim ii As Integer
Noofitrations = Cells(2, 10)
n = Cells(3, 10)
h = Cells(3, 4)
col = 8
x0 = Cells(col, 9)
y0 = Cells(col, 10)
For i = 1 To Noofitrations
Cells(7, 3) = x0
Cells(7, 4) = y0
xn = x0 + h
yn = y0 + Cells(18, 3)
ii i Mod n
If ii = 0 Then
col = col + 1
Cells(col, 9) = xn
Cells(col, 10) = yn
End If
x0 = xn
y0 = yn
Next
End Sub
but while running I am getting "VBA excel compile error : Expected Sub,Function, or property"
I am not understanding what shall i do to run the program
ii i Mod nisn't legal VBA - should this beii = i Mod ninstead?