ExcelBanter

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

Ron de Bruin

SendKeys
 
You can use this

ActiveCell.FormulaR1C1 = "Good"
Application.Goto Cells(1), True
ActiveCell.FormulaR1C1 = "Morning"

Try to avoid Sendkeys


--
Regards Ron de Bruin
(Win XP Pro SP-1 XL2002 SP-2)
www.rondebruin.nl



"Lynn" wrote in message ...
I would like to use the SendKeys statement to perform the
Ctrl + Home keystrokes in my macro. The following
statement works on its own:

Application.SendKeys "^{home}", True

As soon as I combine it with other statements in the
macro, however, it doesn't work. Eg:

ActiveCell.FormulaR1C1 = "Good"
Application.SendKeys "^{home}", True
ActiveCell.FormulaR1C1 = "Morning"

What am I doing wrong?




Lynn[_3_]

SendKeys
 
Thanks for your suggestion Ron. If I have frozen panes,
however, the result is not the same as Ctrl + Home. I
conclude from your comment that SendKeys is flaky in VBA?

-----Original Message-----
You can use this

ActiveCell.FormulaR1C1 = "Good"
Application.Goto Cells(1), True
ActiveCell.FormulaR1C1 = "Morning"

Try to avoid Sendkeys


--
Regards Ron de Bruin
(Win XP Pro SP-1 XL2002 SP-2)
www.rondebruin.nl



"Lynn" wrote in message

...
I would like to use the SendKeys statement to perform

the
Ctrl + Home keystrokes in my macro. The following
statement works on its own:

Application.SendKeys "^{home}", True

As soon as I combine it with other statements in the
macro, however, it doesn't work. Eg:

ActiveCell.FormulaR1C1 = "Good"
Application.SendKeys "^{home}", True
ActiveCell.FormulaR1C1 = "Morning"

What am I doing wrong?



.


Ron de Bruin

SendKeys
 
Hi Lynn

Use this for example with 6 rows freeze

Application.Goto Cells(7, 1), True

conclude from your comment that SendKeys is flaky in VBA?

Yes use it only if there is nothing else

--
Regards Ron de Bruin
(Win XP Pro SP-1 XL2002 SP-2)
www.rondebruin.nl



"Lynn" wrote in message ...
Thanks for your suggestion Ron. If I have frozen panes,
however, the result is not the same as Ctrl + Home. I
conclude from your comment that SendKeys is flaky in VBA?

-----Original Message-----
You can use this

ActiveCell.FormulaR1C1 = "Good"
Application.Goto Cells(1), True
ActiveCell.FormulaR1C1 = "Morning"

Try to avoid Sendkeys


--
Regards Ron de Bruin
(Win XP Pro SP-1 XL2002 SP-2)
www.rondebruin.nl



"Lynn" wrote in message

...
I would like to use the SendKeys statement to perform

the
Ctrl + Home keystrokes in my macro. The following
statement works on its own:

Application.SendKeys "^{home}", True

As soon as I combine it with other statements in the
macro, however, it doesn't work. Eg:

ActiveCell.FormulaR1C1 = "Good"
Application.SendKeys "^{home}", True
ActiveCell.FormulaR1C1 = "Morning"

What am I doing wrong?



.




Lynn[_3_]

SendKeys
 
Thanks Ron!

-----Original Message-----
Hi Lynn

Use this for example with 6 rows freeze

Application.Goto Cells(7, 1), True

conclude from your comment that SendKeys is flaky in

VBA?
Yes use it only if there is nothing else

--
Regards Ron de Bruin
(Win XP Pro SP-1 XL2002 SP-2)
www.rondebruin.nl



"Lynn" wrote in message

...
Thanks for your suggestion Ron. If I have frozen panes,
however, the result is not the same as Ctrl + Home. I
conclude from your comment that SendKeys is flaky in

VBA?

-----Original Message-----
You can use this

ActiveCell.FormulaR1C1 = "Good"
Application.Goto Cells(1), True
ActiveCell.FormulaR1C1 = "Morning"

Try to avoid Sendkeys


--
Regards Ron de Bruin
(Win XP Pro SP-1 XL2002 SP-2)
www.rondebruin.nl



"Lynn" wrote in message

...
I would like to use the SendKeys statement to perform

the
Ctrl + Home keystrokes in my macro. The following
statement works on its own:

Application.SendKeys "^{home}", True

As soon as I combine it with other statements in the
macro, however, it doesn't work. Eg:

ActiveCell.FormulaR1C1 = "Good"
Application.SendKeys "^{home}", True
ActiveCell.FormulaR1C1 = "Morning"

What am I doing wrong?


.



.



All times are GMT +1. The time now is 02:19 AM.

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