+ Reply to Thread
Results 1 to 5 of 5

VBA for Home key

  1. #1
    Alistair Saldanha
    Guest

    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




  2. #2
    Norman Jones
    Guest

    Re: VBA for Home key

    Hi Alistair,

    Try:

    Cells(ActiveCell.Row, 1).Select


    ---
    Regards,
    Norman


    "Alistair Saldanha" <[email protected]> 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
    >
    >
    >




  3. #3
    Alistair Saldanha
    Guest

    Re: VBA for Home key

    Thanks, Norman. That worked like a charm!

    Alistair

    "Norman Jones" <[email protected]> wrote in message
    news:[email protected]...
    > Hi Alistair,
    >
    > Try:
    >
    > Cells(ActiveCell.Row, 1).Select
    >
    >
    > ---
    > Regards,
    > Norman
    >
    >
    > "Alistair Saldanha" <[email protected]> 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
    >>
    >>
    >>

    >
    >




  4. #4
    Forum Expert Cutter's Avatar
    Join Date
    05-24-2004
    Location
    Ontario,Canada
    MS-Off Ver
    Excel 2010
    Posts
    6,451
    That wouldn't be equivalent to using the Home key if there were columns "frozen" using Window > Freeze Panes.

  5. #5
    Alistair Saldanha
    Guest

    Re: VBA for Home key

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

    Alistair


    "Cutter" <[email protected]> wrote in
    message news:[email protected]...
    >
    > 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
    >




+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1