问题描述:

I am trying to simply paste into a cell in Excel. But instead it pastes into my VBA code editor.

Application.Worksheets("ABC").Cells(6, 86).Select

Application.SendKeys "^(v)", True

Appreciate help!

网友答案:

Why Sendkeys?

Sendkeys is highly unreliable. Why not this?

 Worksheets("ABC").Cells(6, 86).PasteSpecial xlPasteAll
网友答案:

You probably need a DoEvents:

Sub demo()
    Range("A1").Select
    Application.SendKeys ("^c")
    DoEvents
    Range("B9").Select
    Application.SendKeys ("^v")
End Sub
相关阅读:
Top