+ Reply to Thread
Results 1 to 9 of 9

Ctrl + Down arrow, jump to end Macro

  1. #1
    Forum Contributor
    Join Date
    06-26-2014
    Location
    Houston
    MS-Off Ver
    365
    Posts
    201

    Ctrl + Down arrow, jump to end Macro

    So what I am trying to do is jump to the bottom of a table, then go down two cells and enter SUBTOTAL for all values above. I noticed when I just Ctrl down arrow, then press down twice, the code that comes up looks like it does jump to the bottom, but when I press the down arrow twice, it then specifically chooses that cell as the starting point. Since each day the row number that this table goes down to changes, it needs to not choose the specific cell that I down arrow to, but just jump down to the bottom of the data, then select whatever cell is two below that. Does this make sense?

    Thanks!

  2. #2
    Forum Expert
    Join Date
    02-14-2009
    Location
    .
    MS-Off Ver
    ................
    Posts
    2,840

    Re: Ctrl + Down arrow, jump to end Macro

    Use End-Down Arrow, s long as there's no blank cells before the end of the data.

  3. #3
    Forum Guru TMS's Avatar
    Join Date
    07-15-2010
    Location
    The Great City of Manchester, NW England ;-)
    MS-Off Ver
    MSO 2007,2010,365
    Posts
    44,908

    Re: Ctrl + Down arrow, jump to end Macro

    If it's a Structured Table, why don't you just swith on the Total row?
    Trevor Shuttleworth - Retired Excel/VBA Consultant

    I dream of a better world where chickens can cross the road without having their motives questioned

    'Being unapologetic means never having to say you're sorry' John Cooper Clarke


  4. #4
    Forum Guru TMS's Avatar
    Join Date
    07-15-2010
    Location
    The Great City of Manchester, NW England ;-)
    MS-Off Ver
    MSO 2007,2010,365
    Posts
    44,908

    Re: Ctrl + Down arrow, jump to end Macro

    You could do something like this:

    Please Login or Register  to view this content.

  5. #5
    Forum Expert
    Join Date
    06-12-2012
    Location
    Ridgefield Park, New Jersey
    MS-Off Ver
    Excel 2003,2007,2010
    Posts
    10,241

    Re: Ctrl + Down arrow, jump to end Macro

    Does something like this help?

    Please Login or Register  to view this content.

  6. #6
    Forum Contributor
    Join Date
    06-26-2014
    Location
    Houston
    MS-Off Ver
    365
    Posts
    201

    Re: Ctrl + Down arrow, jump to end Macro

    Quote Originally Posted by TMS View Post
    You could do something like this:

    Please Login or Register  to view this content.
    This works, however, it adds the subtotal formula to the 4 cells to the right of the needed one also, so D461 is where it needs to be, so I changed the A's to D Does that have something to do with the Resize(, 5) ?

    Dim lLR As Long
    lLR = Range("A" & Rows.Count).End(xlUp).Row

    Range("D" & lLR + 2).Resize(, 5).Formula = _
    "=SUBTOTAL(9,D2:D" & lLR & ")"

  7. #7
    Forum Guru TMS's Avatar
    Join Date
    07-15-2010
    Location
    The Great City of Manchester, NW England ;-)
    MS-Off Ver
    MSO 2007,2010,365
    Posts
    44,908

    Re: Ctrl + Down arrow, jump to end Macro

    Given that there is no sample workbook, or data, or any indication of where the subtotal(s) needed to go, I had to make some guesses. I guessed at subtotals under all columns, starting in column A.

    If you only need one column, just remove the resize.

    Please Login or Register  to view this content.
    Or, if it is a Structured Table, you could use Table References, for example:

    Please Login or Register  to view this content.
    where [d] is the column header in column D

  8. #8
    Forum Contributor
    Join Date
    06-26-2014
    Location
    Houston
    MS-Off Ver
    365
    Posts
    201

    Re: Ctrl + Down arrow, jump to end Macro

    Thats what I figured. Thanks so much! Also, how do I add code in the nice format in the posts?

  9. #9
    Forum Guru TMS's Avatar
    Join Date
    07-15-2010
    Location
    The Great City of Manchester, NW England ;-)
    MS-Off Ver
    MSO 2007,2010,365
    Posts
    44,908

    Re: Ctrl + Down arrow, jump to end Macro

    You're welcome.


    Your post does not comply with Rule 3 of our Forum RULES. Use code tags around code.

    Posting code between [CODE]Please [url=https://www.excelforum.com/login.php]Login or Register [/url] to view this content.[/CODE] tags makes your code much easier to read and copy for testing, it also maintains VBA formatting.

    Click on Edit to open your thread, then highlight your code and click the # icon at the top of your post window. More information about these and other tags can be found here



    If you are satisfied with the solution(s) provided, please mark your thread as Solved.


    New quick method:
    Select Thread Tools-> Mark thread as Solved. To undo, select Thread Tools-> Mark thread as Unsolved.

    Or you can use this way:

    How to mark a thread Solved
    Go to the first post
    Click edit
    Click Go Advanced
    Just below the word Title you will see a dropdown with the word No prefix.
    Change to Solved
    Click Save


    You may also want to consider thanking those people who helped you by clicking on the little star at the bottom left of their reply to your question.

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. [SOLVED] Ctrl + arrow key not working
    By Davi14h in forum Excel General
    Replies: 5
    Last Post: 02-03-2017, 03:10 PM
  2. Ctrl + arrow key not working
    By DamienC in forum Excel General
    Replies: 9
    Last Post: 04-01-2016, 05:23 AM
  3. Ctrl + Arrow key isn't working the way I need it to
    By ipausa in forum Excel General
    Replies: 2
    Last Post: 01-29-2014, 11:00 AM
  4. Can't use CTRL + Arrow to move
    By Dnsierra in forum Excel General
    Replies: 1
    Last Post: 12-12-2009, 03:09 PM
  5. Ctrl+pgup pgdn can't jump worksheets
    By [email protected] in forum Excel Formulas & Functions
    Replies: 0
    Last Post: 08-02-2006, 12:00 PM
  6. Ctrl+pgup pgdn can't jump worksheets
    By [email protected] in forum Excel Formulas & Functions
    Replies: 0
    Last Post: 08-02-2006, 11:45 AM
  7. [SOLVED] Ctrl+Shift+arrow
    By briansetondavis in forum Excel Formulas & Functions
    Replies: 1
    Last Post: 02-18-2005, 10:06 AM

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