title: Row Looping in Excel
body: <p>How to loop a row in excel using c#? </p>
  
  <p>Looping like using datatable</p>
  
  <pre><code>foreach(DataRow _dr in datatable.row)
  {
    //data
  }
  </code></pre>
  
  <p>I'm trying and got this one. But it loops per column</p>
  
  <pre><code>foreach (Excel.Range r in usedRange)
  {
     // check condition:
     try
     {
        if (Convert.ToInt32(r.Value2.ToString()) == 0)
        {
          // if match, delete and shift remaining cells up:
           r.Delete(Excel.XlDeleteShiftDirection.xlShiftUp);
          break;
        }
      }
      catch { }
  }
  </code></pre>