0

我会使用 AHK 将我的文本从 excel 复制并存储到剪贴板。

这是我的代码:

Xl.Range("A1").Copy
Xl.Range("A2").Copy
Xl.Range("A3").Copy
Xl.Range("A4").Copy

如何将 A1-A4 存储到剪贴板?然后我可以手动粘贴剪贴板。

4

1 回答 1

1
Dim wsSource As Worksheet, wsDest As Worksheet
Dim rngSource As Range, rngDest As Range
Set wsSource = ActiveSheet 'or whatever
Set wsDest = wsSource ' or whatever
Set rngSource = wsSource.Range("A1:A4")
Set rngDest = wsDest.Range("C1")
rngSource.Copy rngDest

除非您真的希望它在剪贴板上供用户粘贴到他们可能选择的任何位置,否则您将最后一行更改为rngSource.Copy

于 2013-01-09T18:09:56.467 回答