ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Sendkeys (https://www.excelbanter.com/excel-programming/277213-re-sendkeys.html)

GB[_3_]

Sendkeys
 

"Orlando Magalhães Filho" wrote in message
...
Hi AleP

SendKeys method places keystrokes in a key buffer and they stay there

until
Excel releases keyboard for user could type, this happens, for example, at
the end of the code, when it show a dialog box or a form. Thus, on your
code, keystrokes from SenkKeys will happen then of the Range("A2").Select.

---
Orlando Magalhães Filho


Is there an option to add WAIT at the end of sendkeys, so that the rest of
the code does not execute until cell A5 has been selected?

Is DOEVENTS useful here?

Geoff



(So that you get best and rapid solution and all may benefit from the
discussion, please reply within the newsgroup, not in email)

"AleP" <[email protected] escreveu na mensagem
...
Hi,
I have the following macro:

Sub Sendkeys()
Application.SendKeys ("^{HOME}") ' the same of pressing CTRL+HOME
Range("A2").Select
End Sub


It should select the left top of a database (in my example cell A5

because
in this cell is activated the feature FreezePanes) and then select cell

A2.
But it only selects the left top of database without selecting cell A2

and
I
don't understand why.
Thanks a lot for any help.








All times are GMT +1. The time now is 06:53 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com