title: How to define variable in range
body: <p>I just started VBA coding and I am struck here:</p>
  
  <p>For one cell this program works:</p>
  
  <pre><code>Dim score As Integer, result As String
  
  score = Range("A1").Value
  
  If score &gt;= 60 Then
  
      result = "pass"
  
  Else
      result = "fail"
  
  End If
  
  Range("B1").Value = result
  </code></pre>
  
  <p>And how about a column of cells? Can loop works for this? 
  My code using loop - <strong>But How to define variable in range?</strong></p>
  
  <pre><code>Dim score As Integer, result As String, I As Integer
  
  score = Range("AI").Value
  
  For I = 1 To 6
  
  If score &gt;= 60 Then
  
  result = "pass"
  
  Else
  
      result = "fail"
  
  End If
  Range("BI").Value = result
  
  Next I
  </code></pre>
  
  <p>Thanks in advance!</p>