title: Get filtered values of a specific column in Excel using Office.Interop.Excel in C#
body: <p>I have an Excel sheet named "mySheet" having the columns: "Name", "Gender", "Division".</p>
  
  <p>I want to get an array of students Name whose Division is "D".</p>
  
  <p>Following is my code:</p>
  
  <pre><code>Excel.Sheets ExcelSheets = excelWorkBook.Sheets;
  Excel.Worksheet excelWorkSheet = ExcelSheets.get_Item(1);
  Excel.Range excelRange = excelWorkSheet.UsedRange;
  excelRange.AutoFilter(3, "D", Excel.XlAutoFilterOperator.xlAnd, Type.Missing, Type.Missing);
  Excel.Range firstColumn = excelRange.Columns[1];
  System.Array myvalues = (System.Array)firstColumn.Cells.Value;
  strarrCreateExcel = myvalues.OfType&lt;object&gt;().Select(o =&gt; o.ToString()).ToArray();
  strarrCreateDB = strarrCreateExcel;
  </code></pre>