Private Sub CommandButton1_Click()
Dim a As Variant
Dim b As Variant
Dim n As Long
Dim x As Long
Dim y As String
Dim i As Long
Dim h As Double
Dim e As Long
Dim z As Long
y = InputBox(" Inserisci una funzione y =")
Cells(2, 4) = " " & y
a = InputBox("Inserisci estremo inferiore")
Cells(2, 1) = " " & a
b = InputBox("Inserisci estremo superiore")
Cells(2, 2) = " " & b
n = InputBox("Inserisci il numero delle parti in cui vuoi dividere l'intervallo")
Cells(2, 3) = " " & n
h = (b - a) / n
For z = Range("A2") To b Step h
x = a + h
i = e
For i = i + 1 To n + 1
Cells(i, 11) = x
Next
Next
y = Replace(y, "x", "K1")
Range("L:L") = "=" & y
Range("E2") = h
End Sub
|