is it possible to write integer value to excel

for example extract generic value, parse it to int and put it into excel.

# Write integer value in excel

**abdel**#1

**tjsauter**#2

I think the easiest way around that would be to just add .ToString to the value in the write cell/range activity, excel usually recognizes it as an int when saved and opened again

**ClaytonM**#3

From my experience, if you use an **Excel Scope** Write Cell or Write Range, the built-in Excel feature will automatically recognize the value as a number if there are no non-numeric characters.

Regards.

**abdel**#4

infortunatly no.

i had used Excel scope and write cell: but unformtunatly i canâ€™t do arithmetic function in the Excel sheet .

**ClaytonM**#5

Hi,

Are you trying to Write an Excel Formula? If so, I might be able to help. Most people have problems with quotations because the formula contains quotes so you need to double the quotes. If you provide the function you are trying to write, someone might be able to make a suggestion.

Thanks.

**abdel**#6

simply, I HAD TESTED TWO CELLS (+).

but it did not works, here is the work flowMain(3).xaml (14.0 KB)

**ClaytonM**#7

It looks like you are wanting to change the values in column B and write the integer into column L

Main(3).xaml (8.8 KB)

Here I simplified what you were doing and used the row in the ForEach to find the rowNumber, and checked Add Headers.

Instead of converting the value to an integer, I just used Regex to extract all the numbers out of the value with **System.Text.RegularExpressions.Regex.Replace(row(1).ToString,"[^0-9]","")**

If there are no numbers, it will just be blank.

If there are problems I would need the problem Excel file and what is wrong with it to solve it.

Regards.

**ClaytonM**#9

Hi,

My mistake. Change dt.Rows.IndexOf(row).ToString to this:

**(dt.Rows.IndexOf(row)+2).ToString**

+2 was added because IndexOf for the first row will be zero and since the first row starts on row 2, you need to add 2.

Thanks.