c# - change cells with range.replace -
Well I have a small program in which all Excel cells are replaced by = 'C: \, But I have a problem. I use the range to do this. Location, but my program is wrong, because it does not change in all the cells = 'C: \, only find it first and I do not know the reason.
My code is:
foreach (Excel.Worksheet sheet xlWorkBook.Sheets) {string sheetName = sheet.Name; Console.WriteLine (SHEETNAME); // Sealication Rango Active Category = Sheet Uszd range; // Lear Las Caldes et Rows = Category Ro.kount; Int cols = range.Column.Count; // excel Start Seal = Sheet. Call [1, 1]; //Excel.Range endCell = sheet.Cells [rows, cols]; Sheet. Category ["A1: J000"]. Change (@ "= 'C: \", @ "=' T: \"); // Category = Sheet Range used; // Lier Las Caldas // Int Rows = Range. Ro.kount; // int cols = range.Column.Count; //} // liberalization release object (sheet); }
You need to have another foreach selected Every cell in the category I have no way to test this now, but it should work:
object whatToReplace = "Do you want to change"; Object replacement = "whom do you want to replace it with"; Foreach (range cell range) {cell. Replay (whatToReplace, Replacement); }
Comments
Post a Comment