I
iamnu
The following code is giving me the Run-time error '6' Overflow, and
specifically at the code "ans = var1 * var2".
And I don't understand why, when stepping through this code, it keeps
jumping in and out of the procedure.
I obviously don't know what I'm doing.
FYI, cells D3 and F3 have the following code in them: =RANDBETWEEN
(1,9)
I hope someone can explain...
Private Sub Worksheet_Change(ByVal Target As Range)
Dim var1, var2, ans, tgt
If Target.Column = 8 Then
tgt = Target.Value
var1 = Range("D3").Value
var2 = Range("F3").Value
ans = var1 * var2
Range("D4").Value = var1
Range("F4").Value = var2
Range("H4").Value = tgt
If tgt = var1 * var2 Then
Range("I4").Value = "Correct"
Else
Range("I4").Value = "Wrong"
End If
End If
Calculate
End Sub
specifically at the code "ans = var1 * var2".
And I don't understand why, when stepping through this code, it keeps
jumping in and out of the procedure.
I obviously don't know what I'm doing.
FYI, cells D3 and F3 have the following code in them: =RANDBETWEEN
(1,9)
I hope someone can explain...
Private Sub Worksheet_Change(ByVal Target As Range)
Dim var1, var2, ans, tgt
If Target.Column = 8 Then
tgt = Target.Value
var1 = Range("D3").Value
var2 = Range("F3").Value
ans = var1 * var2
Range("D4").Value = var1
Range("F4").Value = var2
Range("H4").Value = tgt
If tgt = var1 * var2 Then
Range("I4").Value = "Correct"
Else
Range("I4").Value = "Wrong"
End If
End If
Calculate
End Sub