title: Read data from Excel files
body: <p>I'm having some trouble reading from an Excel spreadsheet in C#. 
   I have this code which I read every cell from A to X.</p>
  
  <pre><code>System.Array myvalues; string[] strArray;
  Microsoft.Office.Interop.Excel.Range range = 
      worksheet.get_Range("A" + i.ToString(), "W" + i.ToString());
  
  while(range.Count!=0)
  {
      i++;
      //Console.WriteLine(i);
      range = worksheet.get_Range("A" + i.ToString(), "W" + i.ToString());
      myvalues = (System.Array)range.Cells.Value;
      strArray = ConvertToStringArray(myvalues);
      name = clearstr(strArray[1]);
  
      for ( int j = 1 ; j &lt;= Int32.Parse(number_add_file)*4 ; j++) 
      {
          name = "";
          lang_add = "";
          price = "";
          description = "";
          Console.WriteLine("I got in!");
  
          Microsoft.Office.Interop.Excel.Range range_add = 
              worksheet.get_Range("X" + i.ToString(),Type.Missing);
  
          System.Array values = (System.Array)range_add.Cells.Value;
          string[] str = ConvertToStringArray(values);
          name = str[0];
          lang_add = str[1];
          price = str[2];
          description = str[3];
          Console.WriteLine(name + "   " 
            + lang_add + "   " + price + "   " + description);
  
          addfile();
      }
  </code></pre>
  
  <p>My question is: How could i read next 4 * "number" rows in excel based on "number" value ?</p>
  
  <p>For example:</p>
  
  <pre><code>         A B C D E F G H I J
           a a a a a 1 a a a a 
  </code></pre>
  
  <p>F's cell value is 1 so I would like to read ( G H I J)
  If F's cell value is 2 the I would like to read ( G H I J K L M N)</p>
  
  <pre><code>         A B C D E F G H I J K L M N
           a a a a a 2 a a a a a a a a
  </code></pre>
  
  <p>F's cell value 3 :</p>
  
  <pre><code>        A B C D E F G H I J K L M N O P Q R
          a a a a a 3 a a a a a a a a a a a a
  </code></pre>