qmate1

esci con testvbax.htm


qmate1.xls con excel

tabelle per calcolo quadrato, cubo, radice quadrata di interi positivi e negativi
assegnando inizio e modulo


qvmate1.xls con vba

Private Sub CommandButton1_Click()
Dim k As Integer
Dim inizio As Integer
Dim modulo As Integer
Dim fine As Integer
Dim s1 As Integer
Dim s2 As Integer
Cells(1, 7) = "inizio"
Cells(1, 8) = "modulo"
Cells(1, 9) = "fine"
Cells(1, 1) = "numero"
Cells(1, 2) = "quadrato"
Cells(1, 3) = "cubo"
Cells(1, 4) = "radice q di B"
Cells(1, 5) = "radice q di A"
inizio = Cells(2, 7)
modulo = Cells(2, 8)
fine = Cells(2, 9)
s1 = inizio
For k = 3 To fine
Cells(k, 1) = s1
Cells(k, 2) = (Cells(k, 1)) ^ 2 'quadrato
Cells(k, 3) = (Cells(k, 1)) ^ 3 'cubo
Cells(k, 4) = Sqr(Cells(k, 2)) 'radice quadrata quadrato
If Cells(k, 1) > 0 Then
Cells(k, 5) = Sqr(Cells(k, 1)) 'radice quadrata numero
Else
Cells(k, 5) = Sqr(Cells(k, 1) * (-1)) 'radice quadrata numero
End If
s1 = s1 + modulo
Next k
End Sub

Private Sub CommandButton2_Click()
Rem cancella tutto
Dim k As Integer
Dim fine As Integer
Dim modulo As Integer
inizio = Cells(2, 7)
modulo = Cells(2, 8)
fine = Cells(2, 9)
For k = 3 To fine
Cells(k, 1) = ""
Cells(k, 2) = ""
Cells(k, 3) = ""
Cells(k, 4) = ""
Cells(k, 5) = ""
Cells(k, 6) = ""
Next k
Cells(2, 7) = ""
Cells(2, 8) = ""
Cells(2, 9) = ""
End Sub


qpmate1.xls con vba variante

Private Sub CommandButton1_Click()
Dim inizio, modulo, fine As Integer
Dim k As Integer
Dim s1 As Integer
s1 = Val(TextBox1)
modulo = Val(TextBox2)
fine = Val(TextBox3)
For k = 1 To fine
ListBox1.AddItem (s1)
ListBox2.AddItem (s1 ^ 2)
ListBox3.AddItem (s1 ^ 3)
ListBox4.AddItem (Sqr(s1))
s1 = s1 + modulo
Next k
ListBox1.AddItem ("----------")
ListBox2.AddItem ("----------")
ListBox3.AddItem ("----------")
ListBox4.AddItem ("----------")
End Sub

Private Sub CommandButton2_Click()
ListBox1.Clear
ListBox2.Clear
ListBox3.Clear
ListBox4.Clear
TextBox1 = ""
TextBox2 = ""
TextBox3 = ""
End Sub


qppmate1.xls variante con numeri anche negativi

Private Sub CommandButton1_Click()
Dim inizio, modulo, fine As Integer
Dim k As Integer
Dim s1 As Integer
Dim radiceq As Single
s1 = Val(TextBox1)
modulo = Val(TextBox2)
fine = Val(TextBox3)
For k = 1 To fine
If s1 > 0 Then
radiceq = Sqr(s1)
Else
radiceq = Sqr((s1) * (-1))
End If
ListBox1.AddItem (s1)
ListBox2.AddItem (s1 ^ 2)
ListBox3.AddItem (s1 ^ 3)
ListBox4.AddItem (radiceq)
s1 = s1 + modulo
Next k
ListBox1.AddItem ("----------")
ListBox2.AddItem ("----------")
ListBox3.AddItem ("----------")
ListBox4.AddItem ("----------")
End Sub

Private Sub CommandButton2_Click()
ListBox1.Clear
ListBox2.Clear
ListBox3.Clear
ListBox4.Clear
TextBox1 = ""
TextBox2 = ""
TextBox3 = ""
End Sub