lezawang
Well-known Member
- Joined
- Mar 27, 2016
- Messages
- 1,805
- Office Version
- 2016
- Platform
- Windows
Hi
Not sure what is wrong with the following cold. Thank you so much
+++
Sub grade()
Dim x As Integer
Dim y As Integer
Dim z As Integer
For x = 1 To 20
y = Workbooks(1).Worksheets(2).Cells(x, 1).Value
If y > 80 Then z = "a"
ElseIf y > 60 And y < 80 Then z = "b"
ElseIf y > 50 And y < 60 Then z = "c"
Else
z = "f"
End If
Workbooks(1).Worksheets(2).Cells(x, 3).Value = z
Next
End Sub
Not sure what is wrong with the following cold. Thank you so much
+++
Sub grade()
Dim x As Integer
Dim y As Integer
Dim z As Integer
For x = 1 To 20
y = Workbooks(1).Worksheets(2).Cells(x, 1).Value
If y > 80 Then z = "a"
ElseIf y > 60 And y < 80 Then z = "b"
ElseIf y > 50 And y < 60 Then z = "c"
Else
z = "f"
End If
Workbooks(1).Worksheets(2).Cells(x, 3).Value = z
Next
End Sub