I want to move data from column A to column G of another file, how do I do that?
A->G
B->H
C->I
Best Regrads
I want to move data from column A to column G of another file, how do I do that?
A->G
B->H
C->I
Use read range in range property “A:A” and store in datatable
Use Write range to write in range property “G:G” to a excel file
In write range in add headers mark as true
To move specific column values from one Excel file to the same column in another Excel file in UiPath, you can use the following steps:
Read Data from the First Excel File:
dtSource
).Extract the Specific Column:
dtSpecificColumn
) with the same structure as the source DataTable, but only containing the specific column you want to move. You can use the “Build DataTable” activity to define the structure or filter the column using the “Filter Data Table” activity.Read Data from the Second Excel File:
dtDestination
).Merge the Specific Column:
dtSpecificColumn
.dtDestination
with the value from dtSpecificColumn
for the specific column with “add data row” activity.Write Data to the Second Excel File:
dtDestination
DataTable back to the second Excel file.Hope it helps!!
Have you tried vba yet?
Sub CopyData()
Dim sourceWorkbook As Workbook
Dim sourceSheet As Worksheet
Dim lastRow As Long
Set sourceWorkbook = ThisWorkbook
Set sourceSheet = sourceWorkbook.Worksheets(1)
lastRow = sourceSheet.Cells(sourceSheet.Rows.Count, "A").End(xlUp).Row
Dim anotherWorkbook As Workbook
Set anotherWorkbook = Workbooks.Open("C:\Users\Admin\Documents\AnotherBook1.xlsx")
sourceSheet.Range("A2:A" & lastRow & "").Copy Destination:=ActiveSheet.Range("G2")
sourceSheet.Range("B2:B" & lastRow & "").Copy Destination:=ActiveSheet.Range("H2")
sourceSheet.Range("C2:C" & lastRow & "").Copy Destination:=ActiveSheet.Range("I2")
End Sub
Regards,
Tuan