After copying worksheets around I need to do a find and replace on all the formulae in a worksheet.
In interop I used to simply do
Worksheet.Cells.Replace("x", "y");
The worksheets I am working on have literally hundreds if not thousands of formulae.
Please advise.
Jason
Thanks for your help.
I will give this a try.
I also need to do a find and replace in a chart's series formula.
I used to do it like this...
Series.Formula = Series.Formula.Replace("x", "y");
Can you help?
Jason
Hi,
Well, if you need to get the series’ values/data, you may try to browse the series of the chart using the following attributes of Series class, see the code segment below for your reference.
e.g
Sample code:
…
//Get the first chart in the first worksheet.
var chart = workbook.Worksheets[0].Charts[0];
//Get the first series details.
var series = chart.NSeries[0];
string sname = series.Name;
string seriesvalues - series.Values;
string seriesxvalues = series.XValues;
Hope, this helps a bit.
Thank you.