How to replace the same occurrences in Excel with a different string?
The problem I have with Excel.Range.Replace is that the method replaces all occurrences in a single call. For example if I do the following:
for (int i = 0; i < myNum; i++)
{
myRange.Replace("foo", i.ToString());
}
Then all “foo” will be replaced with 0 instead of 1, 2 ,3 ...
EDIT: Please note that I wrote this code without a c# editor. It will require some corrections. Post comments, if you need any help.