ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   VBA for Home key (https://www.excelbanter.com/excel-programming/348159-vba-home-key.html)

Alistair Saldanha

VBA for Home key
 
Greetings to all!

My question: What is the Excel VBA equivalent of hitting the Home key?
"Selection.End(xlToLeft).Select" won't go all the way to the left if it
encounters a blank cell enroute.

Alistair




Norman Jones

VBA for Home key
 
Hi Alistair,

Try:

Cells(ActiveCell.Row, 1).Select


---
Regards,
Norman


"Alistair Saldanha" wrote in message
news:eM2of.12804$SM5.10883@dukeread02...
Greetings to all!

My question: What is the Excel VBA equivalent of hitting the Home key?
"Selection.End(xlToLeft).Select" won't go all the way to the left if it
encounters a blank cell enroute.

Alistair






Alistair Saldanha

VBA for Home key
 
Thanks, Norman. That worked like a charm!

Alistair

"Norman Jones" wrote in message
...
Hi Alistair,

Try:

Cells(ActiveCell.Row, 1).Select


---
Regards,
Norman


"Alistair Saldanha" wrote in message
news:eM2of.12804$SM5.10883@dukeread02...
Greetings to all!

My question: What is the Excel VBA equivalent of hitting the Home key?
"Selection.End(xlToLeft).Select" won't go all the way to the left if it
encounters a blank cell enroute.

Alistair








Cutter[_21_]

VBA for Home key
 

That wouldn't be equivalent to using the Home key if there were column
"frozen" using Window Freeze Panes

--
Cutte
-----------------------------------------------------------------------
Cutter's Profile: http://www.excelforum.com/member.php...nfo&userid=984
View this thread: http://www.excelforum.com/showthread.php?threadid=49365


Alistair Saldanha

VBA for Home key
 
Not a problem in my current situation but thanks for pointing that out.

Alistair


"Cutter" wrote in
message ...

That wouldn't be equivalent to using the Home key if there were columns
"frozen" using Window Freeze Panes.


--
Cutter
------------------------------------------------------------------------
Cutter's Profile:
http://www.excelforum.com/member.php...fo&userid=9848
View this thread: http://www.excelforum.com/showthread...hreadid=493654





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

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