excel公式从左到右填充

时间:2019-05-13 16:33:29

标签: c# excel

我正在尝试从左到右获取3个单元格,并使用Microsoft.Office.Interop.Excel填充其余的行

xlsxRange = xlsxWorkSheet.Range[xlsxWorkSheet.Cells[52,1],xlsxWorkSheet.Cells[52,g]];
xlsxRange.Interior.Color = XlRgbColor.rgbOrange;
xlsxRange.Borders.LineStyle = XlLineStyle.xlContinuous;
xlsxRange2 = xlsxWorkSheet.Range[xlsxWorkSheet.Cells[52, 1], xlsxWorkSheet.Cells[52, 1]];
xlsxRange2.Value2 = "Total:";
xlsxRange2 = xlsxWorkSheet.Range[xlsxWorkSheet.Cells[52, 2], xlsxWorkSheet.Cells[52, 2]];
xlsxRange2.Formula = "=SUM(B4:B51)";
xlsxRange2 = xlsxWorkSheet.Range[xlsxWorkSheet.Cells[52, 3], xlsxWorkSheet.Cells[52, 3]];
xlsxRange2.Formula = "=SUM(C4:C51)";
xlsxRange2 = xlsxWorkSheet.Range[xlsxWorkSheet.Cells[52, 1], xlsxWorkSheet.Cells[52, g]];

这有什么问题 预先感谢

0 个答案:

没有答案