0

我正在尝试将字母成绩输入到 excel 中,但是当我输入成绩时,它会出现“错误 428,对象不支持此属性或方法”。我究竟做错了什么?

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
4

1 回答 1

2

它应该是

Cells(c, 2).Value = ng

如果您输入A、B、C 之类的字母,您应该会收到类型不匹配错误

另外,我没有看到任何初始化c

于 2013-09-30T02:08:19.883 回答