知识库 KB0160

KB0160:复制选择的多个非相邻单元格失败

问题

无法将选择的多个非相邻单元格复制到 think-cell 数据表中。通过诸如按下 Ctrl 键,然后单击单元格的方式选择多个非相邻单元格后,若随后将这些单元格复制/粘贴到 think-cell 的内部数据表中,会同时粘贴各单元格之间未选择的单元格。

复制的多个单元格和粘贴的多个单元格的视图
  • 源表格:已复制单元格 A1、A3、A5 → 目标表格:已粘贴 A1:A5

说明

这是 Excel 的设计限制。think-cell 的内部数据表基于 Excel,但却是单独的 Excel 进程。将非相邻单元格复制/粘贴到单独的 Excel 进程时,在不使用 think-cell 的情况下也可以重现该问题。

在不使用 think-cell 的情况下重现:

  1. 打开 Excel,将一些数字输入到单元格 A1 到 A5 中。
  2. 按住 Ctrl 键,同时单击 A1、A3 和 A5 单元格以选择这些单元格(如以上屏幕截图中所示)。复制选择对象。
  3. 右键单击任务栏上的 Excel 符号,然后单击 Microsoft Excel 20… 以启动单独的 Excel 进程 如何启动单独的 Excel 进程 在 Excel 2013 和更新版本中,同时按下 ALT 键以启动单独的进程。对于消息您是否要启动新的 Excel 实例?,单击以确认。
  4. 粘贴(例如,通过按 Ctrl + V 执行)。

结果:同时粘贴了未选中的单元格 A2 和 A4。

我们已向 Microsoft Office 支持提出了此问题,案例编号为 112021442496011。Microsoft Office 支持称,此行为迄今并未记录在案,它是“设计有意如此”。

“This behavior is by design.

When you use the clipboard for copy and paste, you are using a feature that is designed to work across all office applications. Since this is the case, the clipboard uses HTML code for storing and then pasting data. The HTML code is limited to a range select and you get all the data in the range including the cells you did not select. It is creating a table in HTML code and uses this table for the paste action. This allows the clipboard to share data from Excel to other office applications such as Word, Power Point, and other instances of Excel outside this workbook.

When you use Ctrl-C and then follow it up with Ctrl-V instead of using the clipboard you are using an internal Excel single instance copy feature that allows Excel to copy only the selected cells. This gives you the desired behavior. The clipboard has limits due to the fact that it shares with all office applications. The limit to the clip board was planned due to the huge amount of data that would be required to do a simple copy and paste. Large copy actions would overwhelm the system and cause huge slowdowns in performance. The HTML copy is a stripped down version of the internal copy and therefore there are differences and limits.” (Microsoft Office Support)

分享