You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When a user references ExcelTable's formulas in cells other than ExcelTable, using structured reference (#This Row), an error occurs when multiple cell formulas are assigned to Contiguous cell range at once
If you don't use the continuous range assignment formula, the relative and absolute references to the formula will be very difficult to handle, and I think this should be a bug to deal with.
var worksheet = package.Workbook.Worksheets["Sheet1"];
var excelTable = worksheet.Tables[0];
[testExcelTable.xlsx](https://github.com/user-attachments/files/17452770/testExcelTable.xlsx)
var col = excelTable.Range.Offset(0,10).TakeSingleColumn(0).SkipRows(1);
var formulaStr = col.TakeSingleCell(0, 0).Formula;
col.Formula = formulaStr;
These are array formulas. Use the CreateArrayFormula(formulaStr, true); for each cell when copying this.
We will look at adding better support for this in a coming version.
It is not an array formula, I just need to copy the formula of the connected area according to the formula of the first cell, similar to the effect of VBA interface Fill Down, in EPPLUS, if there is no structured reference to ExcelTable, you can select a continuous area and then assign the formula value to it. The relative and absolute reference of formulas are processed automatically.
As shown in the image below, what I ultimately need is that after the formula is assigned to the selected continuous region, the content of the formula is different, if it is an array formula the content of the formula is the same.
Finally, I can only use this copy method to go through all the cells to achieve this, but I don't know how the performance is?
var sht = package.Workbook.Worksheets["Sheet1"];
var srcCell= sht.Cells["K2"];
var fillRange = sht.Cells["K3:K5"];
for (int i = 0; i < 3; i++)
{
var dstCell = srcCell.Offset(i + 1, 0);
srcCell.Copy(dstCell);
}
EPPlus usage
Noncommercial use
Environment
Windows
Epplus version
7.4
Spreadsheet application
Excel365
Description
When a user references ExcelTable's formulas in cells other than ExcelTable, using structured reference (#This Row), an error occurs when multiple cell formulas are assigned to Contiguous cell range at once
If you don't use the continuous range assignment formula, the relative and absolute references to the formula will be very difficult to handle, and I think this should be a bug to deal with.
testExcelTable.xlsx
The text was updated successfully, but these errors were encountered: