title: Looping through a range, setting values if condition is met
body: <p>I searched through the stacks but wasn't able to find a question similar to mine. So here's my question:</p>
  
  <p>I want to write a simple macro that evaluates cell B2. </p>
  
  <ul>
  <li>If B2 has a value, I want the macro to paste a value from another worksheet (let's say: worksheet2, cell A1, which says "Award4455") into cell C2; </li>
  <li>if B2 is blank, I want the macro to leave C2 blank. </li>
  </ul>
  
  <p>Then I want to evaluate B3 using the same condition (filling or not filling C3, depending on whether B3 has a value or is blank). I want the formula to loop through 7 rows (B2:B8), filling (or not filling) the corresponding cells in column C.</p>
  
  <p>Here's what I'm trying (unsuccessfully - I keep getting various error messages):    </p>
  
  <pre><code>For i = 2 To 8
  
      Dim Award As String
  
      Award = Sheets("Sheet2").Range("A1").Value
  
      If Len(Range(i, "B")) = 0 Then
          Range(i, "C") = Award
  
      End If
  
  Next i
  </code></pre>