Ciao a tutti, ho il seguente codice:
codice:
Sub Ammortamento_Francese() Dim Capitale As Single
Dim Rate As Single
Dim Interesse As Single
Dim Domanda(3) As String
Dim Dati(3) As Single
Dim I As Integer
Domanda(1) = "Inserisci Capitale"
Domanda(2) = "Inserisci Rate"
Domanda(3) = "Inserisci Tasso Interesse"
I = 0
Do
I = I + 1
Dati(I) = InputBox(Domanda(I))
If Dati(I) = "" Then
MsgBox "Devi inserire un numero"
ElseIf IsNumeric(Dati(I)) = False Then
MsgBox "Il valore inserito non è un numero"
Else
Cells(3 + I, 2).Value = Dati(I)
End If
Loop Until I = 3
End Sub
In pratica se inserisco un valore che non è un numero o una stringa vuota non mi da le msgbox che ho specificato nell'if, ma mi da un errore. Come mai?