Hello guys,
I am facing a problem to copy and paste the required rows before a mentioned name.
In this case , I have to copy all the values from these two columns before “Part A complete”.
And, no. of data may be different in other scenarios.
The whole excel file look like this -
Test_For_Copy_before_specific_column.xlsx (8.9 KB)
Can you please help me??
Thanks & Regards,
Nirmalya Sarkar
Hi,
Use below steps to achive the requirement.
Use excel file / excel application scope to open excel file by giving excel file path.
Use lookup range activity to lookup the specific value in the excel cell we have to provide input what text we are trying to search. Output would be cell reference.
Use copy paste range activity and copy range should be A1:B+Cellreference from above step and paste range or destination should be A1 of some other sheet.
Please try and let us know. Thanks.
prasath_S
(prasath S)
December 15, 2021, 5:17am
3
Hi @nirmalya.sarkar
Please try this,
Read the excel data and store it in a datatable, variable name dt.
Use the query and store the output in a datatable ,variable name dtResult
dt.asenumerable.takewhile(function(row) not row("Sr. No").tostring.trim.equals("Part A complete"))
Write the data back into the excel using write range activity.
Thanks
@prasath_S ,
You mentioned about datatable . So, what datatable activity should i use ??
Can you please tell me?
Thanks & Regards,
Nirmalya
prasath_S
(prasath S)
December 22, 2021, 12:27pm
5
@nirmalya.sarkar .
Please use read range activity, it will store the excel data into a datatable
After that use assign activity and give the query I gave in previous post and save to a datatable variable
Lastly use write range activity and Write the data onto the excel file.
Thanks
@prasath_S ,
I have stored the data and used an assign activity “dtresult” and set the datatype of this variable as “Datatable”.
But it gave some following error-
Can you guide me??
Thanks & Regards
Nirmalya
prasath_S
(prasath S)
December 28, 2021, 11:12am
7
@nirmalya.sarkar
Please try this,
dt.asenumerable.takewhile(function(row) not row("Sr. No").tostring.trim.equals("Part A complete")).copytodatatable
Thanks
system
(system)
Closed
December 31, 2021, 11:50am
8
This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.