Write to a Certain Cell

Hey everyone,

I have a excel sheet which contains “number, date, etc.”

My question is I want to write to the “date” which has the number 22 opposed to it. which the robot will get the number 22 as a variable from the user.image

I want it to write the on date column where number is 22.
Thank you in advance.

Hi kindly try like this:
1)read the excel file and store in datatable dt1
2)use lookup datatable activity with datatable as dt1, lookupvalue as variable as the user is assigned , and also assigned the rowindex property panel with variable called index
3)then after this use write cell activity to write to date column , with cell as “B”+(rowindex+2).Tostring, please note : i assumed date is in column B
In this way you can do this

Mark it as solution if you got it

Nived N
Happy Automation

hello,
image
image

I am getting this error on the write cell activity,

Did I made a mistake on the lookup activity?
thank you

Since index variable store the rowindex ,

So cell should written dynamically as “B”+(index+2).ToString

worked thank you very much, but if the value im looking for does not exist, it rewrites the output value to the header is there any way of controlling it?

If lookup datatable doesn’t find match then it gives output as “-1” .
Apply one if condition for it. If result <0 then no data found

thank you

Hello Berkaykor,

Refer the attached snap which is solution for your question.

rowIndex=yourDataTableName.rows.indexOf(row)+2
and in the write cell activity for range field use “B”+rowIndex.ToString

Thanks,
BTanaji

This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.