1 Function f!(x As Single)
2 f = Sin(2 * x)
3 End Function
4 Sub tabul1()
5 Dim a As Single, b As Single, h As Single, i As Integer
6 a = InputBox("a=")
7 b = InputBox("b=")
8 h = InputBox("h=")
9 i = 3
10 For x = a To b Step h
11 Cells(i, 1) = x
12 Cells(i, 2) = f(x)
13 i = i + 1
14 Next x
15 End Sub
выскакивает сообщение
Compile error:
ByRef argument type mismatch
и выделяет f(x) в строке 12.
Что делать??
Спасибо
F> 1 Function f!(x As Single)
F> 2 f = Sin(2 * x)
F> 3 End Function
F> 4 Sub tabul1()
F> 5 Dim a As Single, b As Single, h As Single, i As Integer
F> 6 a = InputBox("a=")
F> 7 b = InputBox("b=")
F> 8 h = InputBox("h=")
F> 9 i = 3
F> 10 For x = a To b Step h
F> 11 Cells(i, 1) = x
F> 12 Cells(i, 2) = f(x)
F> 13 i = i + 1
F> 14 Next x
F> 15 End Sub
F> выскакивает сообщение
F> Compile error:
F> ByRef argument type mismatch
Поставь в начале модуля Option Explicit и вопросы решаться ;-)
With best regards, Игорь Горбонос. E-mail: ig...@tekom.dp.ua