我想以excel格式插入值,如下所示:-
我有一个列表来存储产品名称及其值。我想插入这些值,但是我得到的行不符合我的要求,但是如何每天按列插入值
在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();