请协助运行以下 Excel 宏。我想我错过了一些东西。逻辑不行。
Sub RiskGrade()
Dim Value1 As String
Sheets("Sheet1").Select
If (Cells(10, 2) = "BX") Then Cells(12, 4) = -8
Exit Sub
ElseIf (Cells(10, 2) = "GX") Then Cells(12, 4) = -7
Exit Sub
Else
For i = 12 To 14
Value1 = Right(Trim(Sheet1.Cells(i, 2)), 1)
'MsgBox Value1
Select Case Value1
Case "W"
Cells(i, 4) = 1
Case "H", "S", "R", "F", "G"
Cells(i, 4) = 2
Case "D"
Cells(i, 4) = 3
Case "C"
Cells(i, 4) = 4
Case "B"
Cells(i, 4) = 5
Case "A"
Cells(i, 4) = 6
Case "*"
Cells(i, 4) = 7
Case "M"
Cells(i, 4) = 8
Case "E"
Cells(i, 4) = 9
Case OTHER
Cells(i, 4) = -9
End Select
Exit For
Next i
End If
End Sub