Reputation: 71
I'm trying to enter letter grades into excel, but when I enter a grade, it comes up with "Error 428, Object doesn't support this property or method." What am I doing wrong?
Option Explicit
Sub HW09()
Dim ng As Integer
Dim v As String
Do
ng = InputBox("Please enter the student's numerical grade.")
If ng < 0 Then
ng = 0
ElseIf ng > 100 Then
ng = 100
Else
End If
Cells(c, 2).Value (ng)
c = c + 1
v = InputBox("Would you like to enter another grade? Type 'Y' for yes and 'N' for no.")
If v = "N" Then Exit Do
Loop
Upvotes: 0
Views: 239
Reputation: 1335
It should be
Cells(c, 2).Value = ng
If you enter letters like A,B,C you should get a Type Mismatch Error instead.
Also, I don't see any initialization for c
Upvotes: 2