如何添加excel单元格的值 [英] How to add values of excel cells

查看:58
本文介绍了如何添加excel单元格的值的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述





我想在我的代码中做类似的事情来添加excel单元格的值



xlWorkSheet1.Cells [i,5] = row [13] .ToString()+ row1 [13] .ToString();



但它只是在一个单元格中并排编写价值



任何人都可以建议我如何添加值excel cell使用c#







谢谢

John

Hi,

I am trying to do something like this in my code to add values of excel cells

xlWorkSheet1.Cells[i, 5] = row[13].ToString() + row1[13].ToString();

But it is just writing the values side by side in one cell

Can anyone suggest me how can I add the values of excel cells using c#



Thanks
John

推荐答案

您好,



您正在连接两个值。如果row [13]和row1 [13]是数值,你需要在相互求和之前进行投射。



如此简单亲爱的。



祝你好运:)
Hi,

You are concatenating two values. if row[13] and row1[13] is numeric value you need to cast before sum each other.

So simple dear.

Best luck :)


这篇关于如何添加excel单元格的值的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆