Option Explicit Private Sub txtQuantità_Change() If txtQuantità.Value <> "" And txtPrezzo.Value <> "" And txtSconto.Value <> "" Then Call Calcola End Sub Private Sub txtPrezzo_Change() If txtQuantità.Value <> "" And txtPrezzo.Value <> "" And txtSconto.Value <> "" Then Call Calcola End Sub Private Sub txtSconto_Change() If txtQuantità.Value <> "" And txtPrezzo.Value <> "" And txtSconto.Value <> "" Then Call Calcola End Sub Sub Calcola() txtImporto.Value = (txtQuantità.Value * 1 * txtPrezzo.Value * 1) - ((txtQuantità.Value * 1 * txtPrezzo.Value * 1) * txtSconto / 100) End Sub
Private Sub CommandButton1_Click() A = txtQuantita.Text * 1 B = txtPrezzo.Text * 1 C = txtSconto.Text * 1 txtImporto = (A * B) - C End Sub