Duplicate / Move sheet from Excel B to Excel A

Hi, i want to know how can i move/duplicate exact same format,column and row from Excel B to Excel A. I had try duplicate sheet as below workflow but it doesnt move to Excel A. Copy/paste do move and copy the data from excel B to A but the problem is i had to readjust the layout and beautify the copied excel sheet .

Hi @SyafiqKCS

Use read range activity to read the data in the Excel B and use write range activity to write the data in excel A.

Hope it helps.

@SyafiqKCS

  1. In copy paste you have option to copy all which will ideally copy the format as well
  2. You can use copy sheet activity which will copy the sheet to the gicen destination file exactly

If you dont find copy sheet you can click on filter in activities and then select classic

Cheers

Hi @SyafiqKCS

Try like this

or try this

I hope it helps!!

dont have any activities for write range but do have write datatable but isnt working

i had try copy paste but i need to adjust the layout

@SyafiqKCS

If you are using StudioX then follow this:

@SyafiqKCS
After copy/paste range activity use Auto fit range activity

Yes its much better, but some row its not so right, myb because the original excel also setting in “wrap text” is there any other suggestion to fix this

Hi @SyafiqKCS

Use this VBA code:

Sub Unwrap_Text()

"unwrap text worksheet named Sheet1"
Worksheets("Sheet1").Range("").WrapText = False

End Sub

Hi @SyafiqKCS

Take one read range workbook activity and give the path of the Excel B file and store the output in a datatable variable.
Use write range workbook activity to write the output datatable variable in to the Excel A file by giving the file path of Excel A in write range workbook activity.
Check the below image for better understanding.
image

Hope it helps!!

@SyafiqKCS

Please try the above option…it would copy whole sheet exactly

Cheers

i cant find the copy sheet, im using studio X, perhaps this wasnt in the option. sry if im wrong

@SyafiqKCS

Instead of copy sheet use copy/paste range activity.

im getting error for the outputdatatable and using variable for the destination to write due to i need to create new sheet right? before copy

can i know where to edit this VBA code

@SyafiqKCS

Write the code in text file by using notepad or any editor.
Use invoke vba activity and pass that file.

Have you created a output variable for read range workbook activity that output variable has to pass in the Write range workbook activity. In my example I give the name of the output variable as OutputDataTable. @SyafiqKCS

Sub Unwrap_Text()

“unwrap text worksheet named B”
Worksheets(“B”).Range(“”).WrapText = False

End Sub

is this the correct code as I name new sheet as B

and this is the workflow

@SyafiqKCS

Yes, the new sheet will be passed into the code.