excel - VBA SendKey Events Happening Out of Order -
excel - VBA SendKey Events Happening Out of Order -
i'm writing simple script re-create , paste cell values manually. know can other means, utilize sendkeys.
here script re-create cell a1 a2:
public declare sub sleep lib "kernel32" (byval dwmilliseconds long) sub my_copy() range("a1").select sendkeys "^c" sleep 10 range("a2").select sendkeys "~" sleep 10 end sub
i can't seem figure out how right issue i'm having. selects cell a1, waits, a2, copies , pastes. (instead of copying after a1 selected)
am missing here?
why not:
range("a2") = range("a1")
where a2 re-create of a1. if want utilize sendkeys, i'd this:
range("a1").select sendkeys "^c", true range("a2").select sendkeys "^v", true 'i'm windows user
the true means wait, that's format excel vba.
excel vba excel-vba
Comments
Post a Comment