Copy data in specific Rows in Excel 1 from Excel 2

Hi team,

how to Copy data in specific Rows in Excel 1 from Excel 2
data

1 Like

Hi buddy @venkateshtangudu

we can use a variable of type datarow and pass that as arrayrow to another with add data row activity

Cheers

hi,

can plz send me sample case…plz

@venkateshtangudu does the columns from both excel sheets are same.

yes…

@venkateshtangudu you want to copy some rows or entire sheet into sheet1

want to copy entire sheet2 to sheet1 in specfic row

1 Like

@venkateshtangudu have you tried with append range activity.

Fine @venkateshtangudu

Kindly follow the below steps that could help you resolve this issue
–use excel application scope and pass the file path of first excel as input
–use read range activity and get the output with a variable of type datatable named dt1
–use a for each row loop and pass the above variable as input
–inside the for each row loop use a if condition to check whether the value of a cell matches say if the column has 7568 then we need to get that column
so lets take the column A has the value 7568 and other numbers along its rows
and condition be like
row(“ColumnAname”).ToString.Equals(“7569”)
(we can even neglect this condition if we know the exact row to be fetched and added to the next excel, and the index of row usually starts from 0)
if the above condition passes then it goes to THEN part where we can get that row alone like this with a assign activity
out_datarow = row("ColumnAname"
where out_datarow is a variable of type datarow
–then outside this for each row activity use a excel application scope and pass the file path of second excel file
–use read range activity and get the output a datatable named dt2
–now use a add data row activity with datatable as dt2 and pass as array row and not as datarow…
where in array row mention like this
out_datarow.Itemarray

thats all buddy you are done
Cheers @venkateshtangudu

1 Like

I think you can try using “read range” to retrieve entire sheet2 and output in a DT variable , then use “append range” or “write range” with specific position to insert the data to sheet1.