Я пытался передать 4 значения в функцию, но четвертое значение кажется не переданным и всегда равным нулю. Вот мой код:
Sub romberg()
'
' romberg Macro
' 3 Sep 2013
'
Dim x0 As Long
Dim fx As Long
Dim x1 As Long
Dim stepsize As Long
Dim J, K, c As Long
Range("A12:N65536").Clear
Columns("A:N").HorizontalAlignment = xlCenter
'column i
'J=0
x0 = Cells(9, 2)
fx = Cells(9, 3)
x1 = Cells(9, 4)
stepsize = Cells(9, 5)
Cells(13, 4) = t(x0, fx, x1, stepsize)
.
.
.
end sub
Public Function t(a As Long, f As Long, b As Long, h As Long)
Dim J As Integer
Sheets("T").Activate
Range("A8:D65536").Clear
Columns("A:D").HorizontalAlignment = xlCenter
Cells(3, 1) = a
Cells(3, 2) = f
Cells(3, 3) = b
Cells(3, 4) = h
.
.
.
t = Cells(3, 6)
End Function