funzioni matematiche
vedi
matema1.xls
funzioni matematiche con VBA su excel

assoluto abs(x)
segno sgn(x)
intero int(x)
quadrato sqr(x)
casuale rnd()
esponenziale exp(x)
logaritmo n. log(x)
logaritmo d. log(x)/log(10)
potenza x^n
seno sin(x)
coseno cos(x)
tangente tan(x)
arcotangente atn(x)


Private Sub CommandButton1_Click()
'matematiche
Cells(1, 1) = Abs(-5)
Cells(2, 1) = Sgn(-5)
Cells(3, 1) = Int(-5)
Cells(4, 1) = Rnd()
Cells(5, 1) = Sqr(4)
Cells(7, 1) = Exp(2)
Cells(8, 1) = Log(100)
Cells(9, 1) = Log(100) / Log(10)
Cells(10, 1) = Sin(30 * 3.14 / 180)
Cells(11, 1) = Cos(30 * 3.14 / 180)
Cells(12, 1) = Tan(30 * 3.14 / 180)
Cells(13, 1) = Atn(2)
Cells(14, 1) = 10 ^ 3
Cells(15, 1) = 10 Mod 3
End Sub

Private Sub CommandButton2_Click()
Dim g As Double
g = 30 * 3.14 / 180
Cells(1, 3) = Abs(5)
Cells(2, 3) = Sgn(5)
Cells(3, 3) = Int(5.42)
Cells(4, 3) = Sqr(5)
Cells(5, 3) = Rnd(5)
Cells(6, 3) = Exp(2)
Cells(7, 3) = Log(100)
Cells(8, 3) = Log(100) / Log(10)
Cells(9, 3) = 5 ^ 3
Cells(10, 3) = Sin(g)
Cells(11, 3) = Cos(g)
Cells(12, 3) = Tan(g)
Cells(13, 3) = Atn(2)
End Sub


Private Sub CommandButton3_Click()
Cells(1, 5) = Abs(-5)
Cells(2, 5) = Sgn(-5)
Cells(3, 5) = Int(-5)
Cells(4, 5) = Rnd()
Cells(5, 5) = Sqr(4)
Cells(7, 5) = Exp(2)
Cells(8, 5) = Log(100)
Cells(9, 5) = Log(100) / Log(10)
Cells(10, 5) = Sin(30 * 3.14 / 180)
Cells(11, 5) = Cos(30 * 3.14 / 180)
Cells(12, 5) = Tan(30 * 3.14 / 180)
Cells(13, 5) = Atn(2)
Cells(14, 5) = 10 ^ 3
Cells(15, 5) = 10 Mod 3
End Sub