Visual Basic For Next?

Question by minidust13: Visual Basic For Next?
I have setup a for next loop to get a number for each month, but I need to test each number to see if it’s Numeric, a non-negative number, and the user can not click cancel to move onto the next month.

I can’t seem to get the cancel to work. I have tried converting a string to an integer and vice versa, but either way I get an error saying I can’t convert.

For intCount = 0 To 11
strM.. GetMonth(intCount)
strM.. InputBox(“Please enter the rainfall for ” & strMonth,
“Rainfall Staistics”)
Do Until IsNumeric(strMonthValue) And strMonthValue <> “” And
Int(strMonthValue) > -1
strM.. InputBox(“Please re-enter the rainfall for ” & strMonth
& ” as a non-negative number”, “Rainfall Statistics”)
Loop
Next intCount

I also tried using a int instead of string, but still produces the same results.

Best answer:

Answer by tev s
Yes, that’s just what happens. Consider yourself lucky, and don’t be so obsessed with finding an answer.

What do you think? Answer below!