我想每天使用epplus库在excel中每天在列中插入值

时间:2019-05-20 11:09:08

标签: c# excel epplus

我想以excel格式插入值,如下所示:-

Insertion format

我有一个列表来存储产品名称及其值。我想插入这些值,但是我得到的行不符合我的要求,但是如何每天按列插入值

在excel中查找正确的行:-


     int rowStart = _objxlsPkg.Workbook.Worksheets[Sheetname].Dimension.Start.Row;
     int rowEnd = _objxlsPkg.Workbook.Worksheets[Sheetname].Dimension.End.Row;

     string cellRange = rowStart.ToString() + ":" + rowEnd.ToString();


     var searchCell = from cell in _objxlsPkg.Workbook.Worksheets[Sheetname].Cells[cellRange] //you can define your own range of cells for lookup
                                     where cell.Value != null && cell.Value.ToString() == Product
                                     select cell.Start.Row;

                    MatchRowOffset = searchCell.First();

0 个答案:

没有答案