hi,
Is there a way a straight forward method to replace all the substring at once in a sheet, so that I can replace all the substrings in a formula “=IFERROR((AVERAGEIFS(Data!$AL$2:Data!ALTEST,Data!$HL$2:Data!HLTEST,A4,Data!$AL$2:Data!ALTEST,”<>")),0)" like “TEST” to “30”. There are thousands of cells with formula.
I know, I can do it by grabbing each cell and replacing it, but it is taking a lot of time to process
Currently using the below code to replace individual cell in c#
Cells helperCells = _SourceWorkbook.Worksheets[“Sheet1”].Cells;
int cnt = 0;
string helper_ftext = null;
for (IEnumerator ie = helperCells.GetEnumerator(); ie.MoveNext();)
{
Cell cell = (Cell)ie.Current;
if (cell.IsFormula)
{
helper_ftext = cell.Formula.Replace("TEST", (DatarowsCount + 1).ToString());
// Apply the formula to particular cell
helperCells[cell.Name].SetArrayFormula(helper_ftext, 1, 1);
cnt++;
}
}
Appreciate if anyone can help.
Thanks