This is my second post in as many hours, not sure if there is a limit on how many times we can post but I was just wondering if you could figure out why this piece of code is not working?
Dim grading As String If score <= 5 Then grading = "Good Job!" ElseIf score < 15 > 5 Then grading = "Better Luck Next Time" End If MessageBox.Show("Your Brain Age is" & score & "." & vbNewLine & vbNewLine & grading, "Brain Age") End Sub Basically what's happening is that when I use the variable grading in the messagebox, the following error comes up
Warning 1 Variable 'grading' is used before it has been assigned a value. A null reference exception could result at runtime.
I'm sure there is a quick and easy solution.
I want to use a string in a messagebox but cannot get it to work - check code
ElseIf score < 15 > 5 Thenis not valid syntax. Is that a typo? What was it supposed to be?