Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我对 VBA 相当陌生,我想出了如何将单元格值从一个工作簿复制到另一个工作簿,假设目标单元格的位置是已知的。
我需要的是用户在工作表中选择一个单元格,当单击附加到宏的命令按钮时,来自固定位置的数据被复制到该单元格。
我真的很感激任何建议......
我需要打开一个新工作簿并复制单元格/命名范围,然后返回到原始工作簿并粘贴到用户选择的位置。在范围的情况下,将所选单元格作为起始单元格。
我使用以下方法来解决我的问题..
我将行和列索引传递给处理复制的函数以获取单元格索引
Activecell.row Activecell.column
然后粘贴到该位置如下...
ThisWorkbook.Worksheets(<worksheetname>).Cells(row,column).pastespecial