+ Reply to Thread
Results 1 to 15 of 15

Using Ctrl + Home to have the first cell selected

  1. #1
    Registered User
    Join Date
    03-16-2009
    Location
    California, USA
    MS-Off Ver
    Excel 2003
    Posts
    98

    Using Ctrl + Home to have the first cell selected

    It's me again.

    I have been searching Excel Help for a code that will allow me to program the Ctrl + Home function.

    Specifically, I have a macro that leaves the selected cell too far down on the spreadsheet. Instead of making the user scroll up or press the Ctrl + Home keys, I want to write a code at the end of my existing macro.

    This is what I have found thus far.
    Please Login or Register  to view this content.
    But it does not seem to be working.

    Please let me know if this can be done with a code?
    Last edited by NaNaBoo; 03-27-2009 at 02:09 PM.

  2. #2
    Forum Contributor GuruWannaB's Avatar
    Join Date
    01-24-2008
    Location
    An hour due East of Cowtown Ohio
    MS-Off Ver
    2010
    Posts
    421

    Re: Using Ctrl + Home to have the first cell selected

    If it's in your code...why don't you add a

    Please Login or Register  to view this content.
    at the end...this will scroll up to row 1
    I help because of the Pavlovian dog that resides in the inner me...so if you are happy with the results, please add to my reputation. It helps keep me motivated!



    Please mark your threads as Solved once it is solved. Check the FAQ's to see how.

  3. #3
    Forum Moderator Leith Ross's Avatar
    Join Date
    01-15-2005
    Location
    San Francisco, Ca
    MS-Off Ver
    2000, 2003, & 2010
    Posts
    23,258

    Re: Using Ctrl + Home to have the first cell selected

    Hello NaNaBoo,

    You don't need SendKeys. You can make cell "A1" lthe active cell like this...
    Please Login or Register  to view this content.
    Sincerely,
    Leith Ross

    Remember To Do the Following....

    1. Use code tags. Place [CODE] before the first line of code and [/CODE] after the last line of code.
    2. Thank those who have helped you by clicking the Star below the post.
    3. Please mark your post [SOLVED] if it has been answered satisfactorily.


    Old Scottish Proverb...
    Luathaid gu deanamh maille! (Rushing causes delays!)

  4. #4
    Forum Expert teylyn's Avatar
    Join Date
    10-28-2008
    Location
    New Zealand
    MS-Off Ver
    Excel 365 Insider Fast
    Posts
    11,372

    Re: Using Ctrl + Home to have the first cell selected

    Range("A1").Select

  5. #5
    Registered User
    Join Date
    03-16-2009
    Location
    California, USA
    MS-Off Ver
    Excel 2003
    Posts
    98

    Re: Using Ctrl + Home to have the first cell selected

    Thanks.

    I did not know.
    Last edited by NaNaBoo; 03-27-2009 at 11:38 AM.

  6. #6
    Registered User
    Join Date
    03-16-2009
    Location
    California, USA
    MS-Off Ver
    Excel 2003
    Posts
    98

    Re: Using Ctrl + Home to have the first cell selected

    Should this be put at the end of my code before the "End Sub"?

    I am not sure where this needs to be incorporated in the code.

  7. #7
    Forum Moderator Leith Ross's Avatar
    Join Date
    01-15-2005
    Location
    San Francisco, Ca
    MS-Off Ver
    2000, 2003, & 2010
    Posts
    23,258

    Re: Using Ctrl + Home to have the first cell selected

    Hello NaNaBoo,

    Post the code you are currently using and we will be able to help you.

  8. #8
    Registered User
    Join Date
    03-16-2009
    Location
    California, USA
    MS-Off Ver
    Excel 2003
    Posts
    98

    Re: Using Ctrl + Home to have the first cell selected

    Here is the actual code.

    Please Login or Register  to view this content.
    Thanks for your help.

  9. #9
    Forum Expert
    Join Date
    01-12-2007
    Location
    New Jersey
    Posts
    2,127

    Re: Using Ctrl + Home to have the first cell selected

    Since setting the focus on cell A1 is the last thing you want to do, just add this code before End Sub

    Please Login or Register  to view this content.

  10. #10
    Registered User
    Join Date
    03-16-2009
    Location
    California, USA
    MS-Off Ver
    Excel 2003
    Posts
    98

    Question Re: Using Ctrl + Home to have the first cell selected

    Oh No!!

    I just used the code that you gave me and I noticed that I am asking for the wrong thing.

    When I ran my code, it did put selected the first cell. However, it do not scroll my page back up to the top. When you physically hit the Ctrl + Home key on your keyboard, it scroll back up to the begin of the spreadsheet

    How do I get this same thing to happen without hitting the Ctrl + Home keys?
    What code would I use.

  11. #11
    Forum Contributor GuruWannaB's Avatar
    Join Date
    01-24-2008
    Location
    An hour due East of Cowtown Ohio
    MS-Off Ver
    2010
    Posts
    421

    Re: Using Ctrl + Home to have the first cell selected

    Use my code that I posted up above instead.....put it right before your END SUB line.

    Please Login or Register  to view this content.
    It does not change which cell is selected...it just simply scrolls all the way to the top row.

  12. #12
    Registered User
    Join Date
    03-16-2009
    Location
    California, USA
    MS-Off Ver
    Excel 2003
    Posts
    98

    Re: Using Ctrl + Home to have the first cell selected

    GuruWannB,

    I apologize for the oversight.

    I did not see that you included in code, I only saw that LeithRoss ask for me to post my code.

    I will try to you have

    Sorry again. I was not trying to ignore your suggestion.

  13. #13
    Registered User
    Join Date
    03-16-2009
    Location
    California, USA
    MS-Off Ver
    Excel 2003
    Posts
    98

    Re: Using Ctrl + Home to have the first cell selected

    Thanks GuruWannaB,

    That's it!! It worked. Now on a side note. If I wanted it to scroll at a certain point in the spreadsheet sheet, could I change this

    Please Login or Register  to view this content.
    To this, for example:

    Please Login or Register  to view this content.

    I am asking just for future reference.

  14. #14
    Forum Contributor GuruWannaB's Avatar
    Join Date
    01-24-2008
    Location
    An hour due East of Cowtown Ohio
    MS-Off Ver
    2010
    Posts
    421

    Talking Re: Using Ctrl + Home to have the first cell selected

    yep...the number is the specific row you want it to scroll up to.


    =)

  15. #15
    Registered User
    Join Date
    03-16-2009
    Location
    California, USA
    MS-Off Ver
    Excel 2003
    Posts
    98

    Re: Using Ctrl + Home to have the first cell selected

    Thanks.

    At least I know for next time.

    I am really trying to learn this language.

+ 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