I am using Epplus
and am using it to input a formula into cells K1
and K2
and this code works great for that. However, I need to "drag" the formulas from K1
and K2
to the right until I reach the last column with data.
My current code is
ws.Cells["K1"].Formula = "=LEFT(K7,(FIND(\" \", K7,1))";
ws.Cells["K2"].Formula = "=RIGHT(K7,LEN(K7)-FIND(\" \", K&,1))";
ws.Cells["K2"].Style.WrapText = true;
ws.Cells["K2"].Style.VerticalAlignment = ExcelVerticalAlignment.Center;
ws.Cells["K2"].Style.HorizontalAlighment = ExcelHorizontalAlignment.Center;