这是我的代码
Sub rangking()
Dim mulai As Integer
Dim akhir As Integer
Dim i As Integer
Application.CutCopyMode = False
mulai = 0
akhir = 60
For i = akhir To mulai Step -1
If Range("data!AC" & i).Value > 90 Then
Range("data!AO" & i).Value = "mumtaz"
ElseIf Range("data!AC" & i).Value > 80 Then Range("data!AO" & i).Value = "jayid jiddan"
ElseIf Range("data!AC" & i).Value > 70 Then Range("data!AO" & i).Value = "jayid"
ElseIf Range("data!AC" & i).Value > 60 Then Range("data!AO" & i).Value = "hasan"
ElseIf Range("data!AC" & i).Value > 50 Then Range("data!AO" & i).Value = "kaaf"
ElseIf Range("data!AC" & i).Value > 45 Then Range("data!AO" & i).Value = "makbul"
Else: Range("data!AO" & i).Value = "rosib"
End If
Next i
End Sub
我有错误“方法'范围'对象'_global'失败” 在行
If Range("data!AC" & i).Value > 90 Then
请帮帮我
答案 0 :(得分:2)
Range("data!AC" & i)
不是您需要单独定义工作表的范围 例如:
Sheets("data").Range("AC" & i)