ZaxAlchemist
New Member
- Joined
- Feb 24, 2021
- Messages
- 3
- Office Version
- 365
- Platform
- Windows
I'm trying to create a Macro to use sendkeys command to copy the value of a cell and paste on another application.
It goes like this:
I'm using the sequence F2 > ^a > ^c, because I need to copy the CONTENT of the cell. If I try using "selection.copy", the destination application won't accept the value.
The code runs, but it basically only executes the "%{TAB}" command and the "~" command, everything else gets "missing"....
Do I need to have any specific reference marked? Is there something that I'm doing wrong?
It goes like this:
VBA Code:
Sub Inicio()
SendKeys "{F2}"
Application.Wait (Now + TimeValue("00:00:02"))
SendKeys "^a"
Application.Wait (Now + TimeValue("00:00:02"))
SendKeys "^c"
Application.Wait (Now + TimeValue("00:00:02"))
SendKeys ("%{TAB}")
Application.Wait (Now + TimeValue("00:00:01"))
SendKeys ("^v")
Application.Wait (Now + TimeValue("00:00:01"))
SendKeys ("~")
End Sub
I'm using the sequence F2 > ^a > ^c, because I need to copy the CONTENT of the cell. If I try using "selection.copy", the destination application won't accept the value.
The code runs, but it basically only executes the "%{TAB}" command and the "~" command, everything else gets "missing"....
Do I need to have any specific reference marked? Is there something that I'm doing wrong?