In Excel, count the rows until the row (Column New), and add the data by 18. The value of 18 is obtained from another Excel file

In Excel, count the rows until the row (Column New), and add the data by 18. The value of 18 is obtained from another Excel file.

Help me resolve this.

image

Use read range for 2 excels
Step1.You can place for each for the fisrt datatable
and create the output for for each as counter

2.Take assign activity inside of for each place the 2nddatatablevariable.rows(Counter).item(“New”)=“18”
3. Use write range for datatable1
Counter is the integer variable created in step1

Data Table 1

image

Data Table 2

@krishnapriya_Anu

Can you please elaborate a litttle on what you mean by col new is 18?

Cheers

You want the entire new column with the values 18
Or

By the values coming from datatable1 means
Just place datatable2 in for each as mentioned above in post1

I have the data table 1
that data table data contain the “COMPANY_CODE”

I have the Data table 2
that contain the name and Number
I add “new column” as “NEW”

I need the output like this = DATA TABLE 2

YES
entire New Column With the value 18

It is very simple use for each row in datatable for 2nd datatable

Inside use assign activity
CurrentRow(“new”)=“18”
Outside the for each use write range for datatable2

If the value is fixed this will work

If there any other you want let me know

Cheers

This is any other Option For This Process

Can you explain more about what is your need

See If you want only 18 means no need of datatable1 cheers

@krishnapriya_Anu

Two ways

  1. Read the data into datatable and then if column is present no add data column else use qdd data column to add New and then assign activity with dt.Columns("ColumnName").Expression = "18"

Second way

  1. Use write cell and write 18 in the first cell C2
  2. Then use auto fill range to fill same till the bottom of table

Cheers