1
我試圖在Excel VBA運行Rungenkutta差的問題 程序如下VBA Excel的編譯錯誤:預期子,函數,或屬性
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
,但在運行我得到「VBA Excel的編譯錯誤:預計SUB,功能,或財產」
我不理解我該做些什麼來運行程序
當它失敗時它指向一行代碼嗎? –
'ii我Mod n'不合法VBA - 應該是'ii = i Mod n'而不是? – barrowc