Append value on the first empty field next to same data

I have process which need to delete a particular columns.copy the remaining columns in the workbook and need to append the data copied to next available empty row in the another workbook. Anyone help me to get this solved.
I’ve tried a VB macro but it failed.

5 Likes

Good evening Rangler,

You should be able to complete this using the following steps:

  1. Read Range (the entire original table)
  2. Filter Data Table (on the second tab, you scan specify which columns to keep or delete)
  3. Write Range (write the updated datatable to the next empty row in your other workbook)

2019-08-24%2020_35_10-Window

Edit: I missed a small section. You can also use the “Go to Next Blank Row” activity in your other workbook to find the cell address you’d like to write the datatable to.

3 Likes

Hi
Welcome to uipath community
—hope these steps would help you resolve this
—in excel application scope activity pass the file path as input and inside the scope use a read range activity and get the output with a variable of type datatable named dt
—now use a assign activity like this
dt = dt.DefaultView.ToTable(False,”columnname1”,”columnname2”)
With this expression we can get the required columns alone in a datatable dt
—now we can use APPEND RANGE ACTIVITY where we can mention the datatable as input and excel file path of where we want to append our datatable

Simple isn’t it
Hope this would help you
Kindly try this and let know for any queries or clarification
Cheers @RenglerDhilip

3 Likes

Thanks for your reply! When I tried to replace using the append range activity, It is overwriting the value in the second workbook. Can you give me a solution to find the next first empty cell in a column and paste the date to it?

  1. Remove the unwanted columns by using Filter Data Table
  2. Use the Merge Data table to Merge the filtered data with the other Data table. Here
    Column names should be the same in both data tables. And write it using write range
    activity
    or
    Use Append Range activity, where column names need not be the same.

:blush:

1 Like


Please find the flow

1 Like

image
Getting this error bro

1 Like

Fine may I know what is the expression mention with DefaultView in the assign activity
We need to check with the column named mentioned in it that is the column name mentioned j that should be there in the datatable as well
Kindly check that once pls
Cheers @RenglerDhilip

1 Like

image

I’ve tried to give some column names

1 Like

Is that datatable Dtout having those columns
Cheers @RenglerDhilip

@Palaniyappan Yes Its a datatable

1 Like

That’s fine buddy
So that datatable have those columns mentioned in the DefaultView
Or
Have we enabled the add headers property In the read range activity
Cheers @RenglerDhilip

2 Likes

We’ve mentioned columns mentioned in the DefaultView and I’ve enabled the add headers property in the read range activity @Palaniyappan

then we should not be facing this issue
if possible can i have view on the excel file with those columnnames , may be with a screenshot

Cheers @RenglerDhilip


Sure @Palaniyappan . Please find the format of the excel file

Did u find the solutions for the above issue?