0
The following Code inserts a Formula into a cell in Excel. Based on the Spreadsheet "DATA", AND According to the column beside. However, this formula is a Matrix Formula, which in Excel needs to be inserted by the keys Ctrl + Shift + Enter. Different from the Basic Formulas, which only with Enter is already inserted.
In Excel, this Formula is inserted with the Ctrl + Shift + Enter keys. It is with {} between them.
However, in the code if I insert these {}, it does not even read as Formula.
Follow the excerpt of the Code, which inserts the Formula.
if (!dado.Equals("Outros"))
{
planilhaGrafico.Cells[i, j].Value = dado;
planilhaGrafico.Cells[i, j + 1].Formula
"=SUM(LEN(" + nomePlanilha + "!" + colunaGrafico
+ ":" + colunaGrafico + ")-LEN(SUBSTITUTE("
+ nomePlanilha + "!" + colunaGrafico
+ ":" + colunaGrafico + ",A" + i + ",\"\")))/LEN(A" + i
+ ")";
}
Does anyone know how to Insert a Matrix Formula, by C#, in Excel.???
Yeah, the command planilhaGrafico.Cells[i, j + 1].Formula
does not insert correctly.