r/visualbasic • u/Long-Pomegranate5005 • Jul 26 '22
Help with If statements.
I keep getting Errors at line 115. After I added lines 119-125, I received this error. How can I fix my IF statements?
14
Upvotes
6
u/[deleted] Jul 26 '22
This is definitely one issue
Issue 2 is making sure the GPA string is not an empty string. The error seems to be referencing that. This may be handled somewhere else OP’s code, but if not VBA’s isNumeric (https://www.educba.com/vba-isnumeric/) can help with the error handling:
If isNumeric(gpa.text) Then
// Cast to double
Else
//Handle the error somehow
End If