How do you write data next to filled cell in an excel file?

I have to write data next to a column that it’s already filled (see image). Is there a way to do this?.

from what i understand, the append range would only write after the last filled column and the write range activity will replace all the data. Do i have to fill the excel files with individual rows?

Excel

@brandon_araya

Could you please tell more details on what basis you want to write here ?

If ‘A’ column contains value then only you want to write in ‘B’ column or what ?

Thats exacly what i want

@brandon_araya

  1. use Read Range activity to read data from Excel file and will give you output as dataTable and say ‘DT’.
  2. Then use For Each Row activity to iterate that DataTable.

ForEach row in DT
Int index = DT.rows.indexOf(row)+2
If Not String.IsNullOrEmpty(row(“FirstColumnName”).Tostring)
Then use Write Cell activity to write into Excel file and pass below.

Range: “B”+index.Tostring
Value: “Required Value”
Else skip.

@brandon_araya

Read the excel and store the data in a datatable dta.

Then use the below query

dta= (from p In dta.Select
        Let x= p(0).ToString+"#"+if(string.IsNullOrEmpty(p(0).ToString,"Required Value",p(1).ToString)
       Select dta.Clone().Rows.Add(x.Split({"#"},stringSplitOptions.None).ToArray)).ToArray.CopyToDataTable

Now write dta into excel by using Write Range.

Regards,
Mahesh

Thanks i’ll try that and i’ll see if i can modify it to add just one Row

Regards

1 Like

Thanks for the query, i’m not that good at Vb .net i don’t understand where do i input the data to fill the other columns