C# Excel Automation: Retrieving rows after AutoFilter() with SpecialCells() does not seem to work properly

后端 未结 3 1535
耶瑟儿~
耶瑟儿~ 2021-01-13 02:55

First time poster here :). I\'m having the following trouble automating Excel 2010 from a WinForms C# application. My test table looks the following way:

Ind         


        
3条回答
  •  时光说笑
    2021-01-13 03:55

    I used this below method to get the data inside the range,

    foreach (Excel.Range area in visibleCells.Areas)
    
      {
         foreach (Excel.Range row in area.Rows)
         {
             int index = row.Row; // now index is the present Row index within the range.you
             string test = Mysheet.Cells[index,4].Values // Mysheet is my present working sheet. After this test will contain the values pointing to the values.cells[index,4].
         }
    }
    

提交回复
热议问题