How can I write into the “KOMADA” column the result obtained by dividing the “saldoeura” colimn by 1.9?
Hey @dvojinovic ,
Follow the steps
- Read the excel file and store the value in dt_input
- Create a intCounter variable and assign with 2
- Take for each row in data table activity and pass the dt_input
- Inside the for each row in data table take one assign activity and pass the value like this
DoubleInputValue = Cdbl(CurrentRow("saldoeura").ToString.Trim.Replace(",",""))
- Now divide the value like this
DoubleResult = DoubleInputValue / 1.9
- Use Write cell activity and in the cell pass
"M"+intCounter.ToString
and value you can pass the DoubleResult.ToString - increment the counter after the for writecell activity like this
intCounter=inCounter+1
Everything should happen in a loop
That’s all
Expressions for Write Cell activity :
What to write:
(CDbl( CurrentRow("saldoeura").ToString)/1.9).ToString()
Where to write: Excel.Sheet("Sheet1").Cell("M"+dt_inputdata.Rows.IndexOf(CurrentRow)+2).ToString())
Hi @dvojinovic
You can make use of invoke code
For Each row As DataRow In YourDataTable.Rows
row("KOMADA") = Math.Round(CDbl(row("saldoeura").ToString.Replace("," , ".")) / 1.9, 2)
Next
Here in the Komodo column the “,” is replaces as decimal (.)
If you want to ignore the “,”
For Each row As DataRow In YourDataTable.Rows
row("KOMADA") = Math.Round(CDbl(row("saldoeura").ToString.Replace("," , "")) / 1.9, 2)
Next
Hope this helps!
Just use write cell activity to write the formula in M2 cell. Then use Fill Range activity to fill the remaining column with the formula at M2 cell.
- Write cell formula activity with formula as
=L2/9
in M2 cell - Auto fill range to fill formula down
Cheers
Hi @dvojinovic
Use the below formula in Fill Range activity:
"=SUBSTITUTE(A2,"","",""."")/1.9"
Hope it helps!!
This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.