ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Can "Home" key be VBA programmed? (https://www.excelbanter.com/excel-programming/318353-can-home-key-vba-programmed.html)

Simon Hughes

Can "Home" key be VBA programmed?
 
I need to recreate the "Home" key sequence in VBA in which the cursor
immediately move to column A. So far I've not been able to do so. The
closest I've come is:

Selection.End(xlToLeft).Select

This onlyn recreates a "Ctrl Left", so, depending on the sheet, you may have
to do a number of these to get to column A.

Is this possible?



Chip Pearson

Can "Home" key be VBA programmed?
 
Simon,

Try something like

Sub AAA()
Cells(ActiveCell.Row, "A").Select
End Sub




"Simon Hughes" wrote in message
news:xkHsd.719158$8_6.323824@attbi_s04...
I need to recreate the "Home" key sequence in VBA in which the
cursor
immediately move to column A. So far I've not been able to do
so. The
closest I've come is:

Selection.End(xlToLeft).Select

This onlyn recreates a "Ctrl Left", so, depending on the sheet,
you may have
to do a number of these to get to column A.

Is this possible?





Simon Hughes

Can "Home" key be VBA programmed?
 
Many thanks, that did it!

"Chip Pearson" wrote in message
...
Simon,

Try something like

Sub AAA()
Cells(ActiveCell.Row, "A").Select
End Sub




"Simon Hughes" wrote in message
news:xkHsd.719158$8_6.323824@attbi_s04...
I need to recreate the "Home" key sequence in VBA in which the
cursor
immediately move to column A. So far I've not been able to do
so. The
closest I've come is:

Selection.End(xlToLeft).Select

This onlyn recreates a "Ctrl Left", so, depending on the sheet,
you may have
to do a number of these to get to column A.

Is this possible?








All times are GMT +1. The time now is 01:37 AM.

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