0
如何讀取特定列範圍(「A4」)到列(「G4」)以及所有行下面的行。如何在c#中讀取excel中的特定範圍?
Excel.Worksheet worksheet = (Excel.Worksheet)workbook.Worksheets["Trading Desks"];
Excel.Range range = worksheet.get_Range("A4:G4", Type.Missing);
int rowCount = range.Rows.Count;
int colCount = range.Columns.Count;
//access the cells
for (int row = 1; row <= rowCount; ++row)
{
for (int col = 1; col <= colCount; ++col)
{
}
}
但我總是得到一行數。如何獲取所有行並從中獲取值?
這就是問題所在。我不知道哪些行會結束,可能是G6或G100。如何找到最後一列? – James123 2014-12-03 18:18:44