需要从 Excel 插件访问选定的数据 (Visual C#)

发布于 2024-10-01 19:51:16 字数 206 浏览 0 评论 0原文

我正在尝试构建一个插件,它可以从 Excel 工作表中选择一些单元格,然后将它们放在我选择的第一个单元格中。单元格之间将有一个用户选择的分隔符。

例子: 我选择 3 个单元格 A1-A3,其值为 AB 和 C 然后我打开我的插件并选择分隔符为“,”。 然后,插件应将字符串“A、B、C”放入单元格 A1 中。

但我不知道如何访问我在 Excel 工作表中选择的数据。

Im trying to build a addin that can take some a selection of cells from a excel sheet and then put them together in the first cell i have celected. Between the cells there will be a user selected seperator.

example:
I select the 3 cells A1-A3 with the values A B and C
I then bring up my addin and chose the seperator to be ", ".
The addin should then place a the String "A, B, C" in the cell A1.

But I cant figure out how to access the data I have selected in the excel sheet.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

铜锣湾横着走 2024-10-08 19:51:16
var range = (Range)Globals.ThisAddIn.Application.ActiveWindow.Selection;
var range = (Range)Globals.ThisAddIn.Application.ActiveWindow.Selection;
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文