我刚开始VBA编码和我在这里打:如何定义范围内可变
对于一个小区这个程序的工作原理:
Dim score As Integer, result As String
score = Range("A1").Value
If score >= 60 Then
result = "pass"
Else
result = "fail"
End If
Range("B1").Value = result
以及如何对单元格列?循环可以为此工作? 我的代码使用循环 - 但如何定义范围内的变量?
Dim score As Integer, result As String, I As Integer
score = Range("AI").Value
For I = 1 To 6
If score >= 60 Then
result = "pass"
Else
result = "fail"
End If
Range("BI").Value = result
Next I
在此先感谢!
耶! :D我现在明白了;我的代码{私人小组CommandButton1_Click() 昏暗得分作为整数,导致作为字符串,确定作为整数 对于OK = 1至10 得分=细胞(确定,1)。价值 如果得分> = 60然后 结果= “通过” 否则 结果=“失败” 结束如果 细胞(确定,2)。价值=导致 接着确定 结束子} – mob