Oppure

Loading
15/11/11 9:28
j7-na
Buongiorno ragazzi,
gentilmente vi chiedo novità su questo mio problema. Mi sto esaurendo...non riesco a trovare il problema! :d


Grazie :asd:
aaa
15/11/11 12:26
j7-na
Ho risolto ragazzi. Ecco il codice:

Private Sub Command1_Click()
On Error Resume Next
totale = Val(Text1.Text)
totale = 0

Do
N = InputBox("Quante case vuoi caricare?" & vbCrLf & _
"(Inserire un valore minore di 10)", "richiesta numero dati")
Loop While N > 10

For I = 1 To N
Numeri(I) = InputBox("Inserisci Numero Casa", "Inserimento Dati")
Valore(I) = InputBox("Inserisci Valore", "Inserimento Dati")
Next I

For I = 1 To N
totale = totale + Valore(I)
Next I

Text1.Text = totale

Dim q As Double
Dim modulo As Double
Dim out1 As Double
Dim out2 As Double
Dim resto As Double

modulo = 10
q = Fix(totale / modulo)
out1 = q * modulo
out2 = totale - out1
If out2 >= 0 And out2 < 5 Then
modulo = 10
q = Fix(totale / modulo)
totale = q * modulo
Text7.Text = totale
Text6.Text = Round(out2, 3)
ElseIf out2 >= 5 And out2 <= 9 Then

resto = out2 - 5
Text7.Text = totale - resto
Text6.Text = Round(resto, 3)
End If

End Sub


In pratica ho eliminato la funzione "Calcolo" ed ho inserito tutto nel Command1, ed ho pure gestito il periodico con la funzione "Round".

Grazie lo stesso! :k:
Ultima modifica effettuata da j7-na 15/11/11 12:27
aaa