私は、Visual Basic の恥ずかしくて厄介な小さな問題に苦労してきました (お分かりのように、私はおそらく初心者です)。問題は、数字の代わりに文字が入力された場合のエラー メッセージ システムです。「整数から文字列に変換できません。
これに関する任意の助けをいただければ幸いです。
これが私のコードです:
Dim number1, number2 As Integer
Dim sum As String
number1 = InputBox("first value:")
number2 = InputBox("second value:")
sum = number1 + number2
If IsNumeric(sum) Then
MsgBox("The sum of the numbers " & number1 & " and " & number2 & " is: " & sum)
ElseIf Not IsNumeric(sum) Then
MsgBox("You may only type numbers into the fields!, trie again")
End If
よろしくお願いします:)!