How to convert DataRow to DataTable

I am new to DataTable manipulation.

It’s probably a simple process, but it’s so simple that I can’t find the information I want because it’s not on the Internet.

So, I’m sorry, but what is the best way to make the following information into a DataTable?

・DataTable1.Rows(1)

Specifically, I would like to copy and paste the second row of an Excel DataTable that is already open in ExcelApplicationScope and paste it at the bottom.

I would appreciate it if you could tell me where the DataTable should be written in Write Range.

Thank you very much.

Hi,

Can you try to extract newDataTable using the following expression, then use AppendRange or WriteRange Activity?

newDt = {DataTable1.Rows(1)}.CopyToDataTable

If you use WriteRange, need to calculate start address using DataTable1.Rows.Count etc.

Regards,

1 Like

Thank you very much for your reply, Yoichi.

I’ve just tried to check the operation.
It was indeed copied and written in Write Range.

However, I’m sorry to say that the row I want to copy includes the cell color and formatting information, and the method you taught me is just copying and pasting the values.

I’m sorry, but is there any way to copy and paste the values, including the background color of the cell and the formatting of the text?

Thank you very much for your help.

Hi,

How about using CopyPasteRange Activity?

To get destination address, DataTable.Rows.Count will help you.

Regards,

1 Like

Thanks

I did not check the Activity.
And then, I done the activity, and works.

Thank you for introduce this activity

1 Like

This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.