How to copy data from one excel sheet to different excel sheet in same workbook


#1

I will get the excel sheet through mail. I have to copy data from one excel sheet to another excel sheet
in same workbook based on some condition.
condition:If the value in particular column is not equal to ‘0’ we have to copy to another sheet.


How to Create Lots of Activities Quickly?
#2

Hey @Ananthaeswar2

Please search forum first before posting…

This thread already covered this problem and condition you can manage.

Regards…!!
Aksh


#3

In that example which is given by you,there we are copying the whole data,but i have to copy specific rows based on one condition.
condition:If the value in particular column is not equal to ‘0’ we have to copy that row to another sheet.


#4

That can be done by combining some tips.

First filter your original datatable by
DataTableName.Select(Condition)

It returns an array of DataRow and you can create new datatable, then add that DataRows in the array to the new datatable.

Then you can output it to the Excel file according to the advice above.


#5

Hey @Ananthaeswar2

You can try this sample and let me know :slight_smile: Copy_some_row_sample.zip (6.4 KB)


#6

Thank You so much @aksh1yadav :slightly_smiling_face: it worked.


#7

I want to copy data from from one excel file and paste into tge different excel file can you please help me


#8

Hey @Uma

You can following steps to achieve that.

  1. Use Excel Application Scope Activity and pass it that file name(if that excel file is exists in the same directory where that workflow also exists or you are running from there) or browse that file from explorer.

  2. Inside excel application scope use Read range Activity and pass the sheet name to it and left Range to " ". This activity will reuturn you a datatable as an output.Assign that output into a datatable variable.

Note - change the scope of read range output datatable because by default it scope is inside excel application scope only so make it within sequence to write it into another excel scope.

  1. Then again use Excel application scope with then new file name or exists file name if you wants to write data into that file.
    if that file does not exists at the mentioned path then Excel application scope will generate that excel for you.

  2. Use write range Activity inside that Excel application scope and pass that datatable to it.

Regards…!!
Aksh


#9

It is an broweser generated file(want to copy from that file)so this file is not saved and by using read and write range data overrites i just want to clear the data present on the destination file sheet (file i want to paste data) and then paste the data .i did it by using front end( using short keys) but while pasting the format got change.please help me ASAP.
Thanks,Uma


#10

Hey @aksh1yadav i have one question.
There are some codes in one column,for every change in code in that column,i have to include an empty row, means i have to group the same codes between the empty rows.
can you please me with that.
Thanks
Anantha


#11

Hello,
Can you please help me on this
How to move or copy one sheet to another workbook.
Waiting for reply.
Thank,
Uma


#12

@Uma you can use read range in source excel and you will get output as datatable and write range in destination excel with that datatable


#13

@aksh1yadav Hi,
I have one question if i want to copy one single row from one excel and 20 rows from other excel into one resultant excel, i want to repeat this activity till the first excel as no more rows left and the 2nd excel 20 rows must must be repeated same for all the rows taken from 1st excel.
Can you suggest me on this.

thanks in advance
Shrunga