How to write data from sheet 1 to sheet 2

I have a task dropdown… It contains plenty of tasks name… So for each task name some data need to be extracted and need to write it in sheet 1.
Sheet 2 is an excel template… This is the final template so i need to write data from sheet 1 to sheet 2 corresponding to there column names. can anyone please help me to try out this.

SampleExcel.xlsx (9.4 KB)

Hi @Chippy_Kolot

You want to write the Data1 column values in Sheet1 to Data1 Column in Sheet2. Am I right?

Yes,Exactly i want it to write like that.

Hey @Chippy_Kolot, After seeing sheet 1, I think sheet 2 will have only one row. Are you expecting more than one row?

yes…Sheet2 will be having only one row

there are several options to do it.

We can use sheet1 data and create for us a lookup data dictionary:
grafik

then we can use for sheet2 a dtData2.NewRow for getting an empty row within the Sheet2 Schema which we can populate with the help of the lookup data dictionary

2 Likes

Okay Got it @Chippy_Kolot

You can use the Vb code to use in Invoke vba activity.
→ Use the Excel Process scope activity and insert Use excel file activity, give the path of the excel file in Use excel file activity.
→ Insert the Invoke vba activity inside Use excel file activity.
→ Check the below text file which contains the vb code in it.

WriteDataToSheet2.txt (1.0 KB)

→ Give the path of the text file in the Code file path field and give this “WriteDataToSheet2” method name in the Entry method name field.

Check the below workflow for better understanding,

Output -

Hope it helps!!

I have attached the workflow . You can basically leverage lookup datatable activity and achieve this.I have put the data in separate variables but you can customize it as per your needs
SplitData.xaml (20.6 KB)
Hope it helps!

As A variation and reducing some steps we can also do like:

grafik

Creating an adhoc DataTable form the LookUp Dictionary - dtAdditions
grafik

And using a merge DataTable activity where we merge dtAdditions into dtSheet2Data

1 Like

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