title: loop on the rows in excel vba and get cell
body: <p>I need help in Excel. My question is: How can I get the cell 42 of each row in this loop? As: </p>
  
  <pre><code>For Each r In Sheets("Sheet2").UsedRange.Rows
       sval = r.Cells(42)
  
       If sval = "" Then
           If r.Cells(6).Value &lt;&gt; "" And r.Cells(7).Value &lt;&gt; "" And r.Cells(9).Value &lt;&gt; "" And r.Cells(10).Value &lt;&gt; "" And r.Cells(11).Value &lt;&gt; "" And r.Cells(12).Value &lt;&gt; "" Then
               MsgBox "wtehi"
               r.EntireRow.Interior.ColorIndex = 0
           Else
               MsgBox "yallow"
               emptyMand = "ok"
               r.EntireRow.Interior.ColorIndex = 6
           End If
       End If
  
  Next
  </code></pre>