We're sorry Aspose doesn't work properply without JavaScript enabled.

Free Support Forum - aspose.com

Insert a value into multiple rows of a single column

Hi,
I have requirement like we need to insert a column with same data into an excel sheet.
I can achieve that using foreach loop.

But I want to do that in a single shot like some range.putvalue(“ABC”)

Please help me on this.
We are using aspose.cells for .net.

Thanks & Regards ,
Srikanth G

Hi Sritanth,


Thank you for contacting Aspose support.

I believe you already know the solution to the mentioned problem, that is; using Range.PutValue method. Please check the following piece of code that creates a range from A1 to A10 and puts the value (ABC) in all cells of the range.

C#

var book = new Workbook();
var sheet = book.Worksheets[0];
var cells = sheet.Cells;
var range = cells.CreateRange(“A1:A10”);
range.PutValue(“ABC”, false, false);
book.Save(“C:/temp/output.xlsx”);