vba1.txt

(0 KB) Pobierz
Option Explicit
Dim X As Double, Z As Double
Dim N As Integer, K As Integer, i As Integer
Dim S As Double
Dim L As Double
Dim w As Double

Sub rereg()
Range("A1:H100").Clear
Cells(1, 1) = "wartoϾ x"
Cells(1, 2) = "Wynik Logarytmu"
Cells(1, 3) = "Wynik rozwiniêcia"
Cells(1, 7) = "Iloœæ punktów rozwiniêcia"
Columns("A:H").AutoFit

Do
X = Application.InputBox("podaj X", "X", Type:=1)
If Abs(X) >= 100 Then
MsgBox "Popraw podany punkt", vbOKOnly + vbExclamation, "B³¹d w danych"
End If
Loop While Abs(X) >= 1


Do
K = Application.InputBox("podaj iloœæ punktów dla jakich ma byæ policzona wartoœæ X", "K", Type:=1)
If K < 1 Then
MsgBox "iloœæ punktów nie mo¿e byæ mniejsza ni¿ 1", vbOKOnly + vbExclamation, "B³¹d w danych"
End If
Loop While K = 1

Cells(1, 8).Value = K


For i = 1 To K + 1
L = K + i
Cells(1 + i, 2).Value = L


w = 1
N = 1
 
 Do
 
 N = N + 1
 S = S + w
 
 w = N + ((X ^ i) * (Log(2#)) ^ i) / K
 Loop While L + 1 > 100
 
 
 
 
 

 End Sub
Zgłoś jeśli naruszono regulamin