如何在Excel工作表中使用C#获取当前或聚焦的单元格值 [英] How to get current or focussed cell value in Excel worksheet using C#
本文介绍了如何在Excel工作表中使用C#获取当前或聚焦的单元格值的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
请帮助我通过代码获得相同的。
而且我也想用C#学习VSTO Excel。建议我一些很好的电子书免费下载和任何网页链接相同。
如何使用C#获取聚焦或VSTO excel中当前单元格的列值
解决方案
Excel.Range rng =(Excel.Range)this.Application.ActiveCell;
//获取单元格值
对象cellValue = rng.Value;
//获取行和列详细信息
int row = rng.Row;
int column = rng.Column;
Please help me through a C# code that In VSTO excel whereever i selected a cell the respective column gets focussed. I need to get the Column value(which column) and row value(which row no) on excel worksheet wherever i focussed.
Please help me to get the same through code.
And also i would like to learn VSTO Excel using C#. Suggest me some good ebooks free downloadable and any web links for the same.
how to get focussed or current cell's column value in VSTO excel using C#
解决方案
Excel.Range rng = (Excel.Range) this.Application.ActiveCell;
//get the cell value
object cellValue = rng.Value;
//get the row and column details
int row = rng.Row;
int column = rng.Column;
and here's a quick start walkthrough.
这篇关于如何在Excel工作表中使用C#获取当前或聚焦的单元格值的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文