Insert Row in Excel

A

Andy

I have a function that is populating an existing Excel spreadsheet with data, and as I go through the function I need to add a row. Can somebody help me out with code to insert a new row? I basically need to add a row, populate the row with data, and then move on to the next record in the dataset and add another row, etc

Thanks
 
N

Nikerz Inc

Hi Andy,

With your dataset you can add all the information first then export it out
to excel. The second option which I haven't done is inserting a row in the
excel sheet. This is a C# example but I think if you look up
datatable.rows.add you'll be able to find the information your looking for!
Holla back when you have a look at this if it fits your solution.

Datarow row = tableEmp.NewRow();
Row["ID"]=1;
Row["Name"] = "Joe User";
tableEmp.Rows.Add(row);


Andy said:
I have a function that is populating an existing Excel spreadsheet with
data, and as I go through the function I need to add a row. Can somebody
help me out with code to insert a new row? I basically need to add a row,
populate the row with data, and then move on to the next record in the
dataset and add another row, etc.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,769
Messages
2,569,576
Members
45,054
Latest member
LucyCarper

Latest Threads

Top