binomio
prodotto di due binomi di primo grado, con Excel vedi binomio.xls
a1 | 1 | =B6 | x^2 | =B7 | x | =B8 | ||
b1 | -1 | |||||||
a2 | 2 | |||||||
b2 | 3 | |||||||
m | =B1*B3 | calcolo | ||||||
n | =B1*B4+B2*B3 | calcolo | ||||||
p | =B2*B4 | calcolo | ||||||
prodotto di due binomi con VBA su Excel binomiox.xls
copiare codice VBA in foglio
Excel (creare due pulsanti, aprire pulsante 1 e incollare
codice):salvare foglio
vedi descrizione per copiare e incollare codice VBA da inserire
nel foglio di Excel,
http://digilander.libero.it/francescovise/vbacodice/vbaspiegafoto.htm
http://digilander.libero.it/francescovise/vbacodice/spiega1.htm
Private Sub
CommandButton1_Click()
Rem prodotto due binomi primo grado
Cells(1, 1) = "a1"
Cells(2, 1) = "b1"
Cells(3, 1) = "a2"
Cells(4, 1) = "b2"
Cells(5, 1) = "m"
Cells(6, 1) = "n"
Cells(7, 1) = "p"
a1 = Cells(1, 2)
b1 = Cells(2, 2)
a2 = Cells(3, 2)
b2 = Cells(4, 2)
m = Cells(1, 2) * Cells(3, 2)
n = Cells(1, 2) * Cells(4, 2) + Cells(2, 2) * Cells(3, 2)
p = Cells(2, 2) * Cells(4, 2)
Cells(5, 2) = m
Cells(6, 2) = n
Cells(7, 2) = p
Rem stampare segno + se coefficiente positivo
Rem se negativo viene stampato automaticamnte
If Cells(6, 2) > 0 Then
sn = "+"
Else
sn = ""
End If
If Cells(7, 2) > 0 Then
sp = "+"
Else
sp = ""
End If
Cells(8, 4) = sn
Cells(8, 5) = sp
Cells(10, 1) = "prodotto di due binomi di primo grado"
Cells(11, 1) = " (a1x + b1) * (a2x + b2) = mx^2 +nx + p
"
Cells(14, 1) = "inserire i coefficienti nelle celle
indicate"
Cells(15, 1) = "risultato trinomio 2° "
Cells(16, 1) = Cells(5, 2) & " x^2 " & Cells(8,
4) & Cells(6, 2) & " x " & Cells(8, 5)
& Cells(7, 2)
End Sub
Private Sub
CommandButton2_Click()
For riga = 1 To 17
For colonna = 1 To 7
Cells(riga, colonna) = ""
Next colonna
Next riga
End Sub