+ Reply to Thread
Results 1 to 5 of 5

Reselect cell after pressing enter

  1. #1
    Forum Contributor
    Join Date
    04-03-2009
    Location
    USA, California
    MS-Off Ver
    Excel 2007
    Posts
    385

    Reselect cell after pressing enter

    I need a private sub for a workbook that will switch back to the entry cell after the selection is made and calculate. Meaning Cell A2 is the cell where data is entered and after pressing enter or tab or clicking out of cell A2, cell A2 should be reselected and a calculate command should be issued. How can this be done?
    Last edited by randell.graybill; 05-19-2010 at 11:41 PM.

  2. #2
    Forum Expert JBeaucaire's Avatar
    Join Date
    03-21-2004
    Location
    Bakersfield, CA
    MS-Off Ver
    2010, 2016, Office 365
    Posts
    33,492

    Re: Reselect cell after pressing enter

    If you want a calculation to occur when data is entered every time, leave Auto Calculation on....

    Anyway, to reselect a cell you just changed and tell the worksheet to calculate, put this in the sheet module:
    Please Login or Register  to view this content.
    _________________
    Microsoft MVP 2010 - Excel
    Visit: Jerry Beaucaire's Excel Files & Macros

    If you've been given good help, use the icon below to give reputation feedback, it is appreciated.
    Always put your code between code tags. [CODE] your code here [/CODE]

    ?None of us is as good as all of us? - Ray Kroc
    ?Actually, I *am* a rocket scientist.? - JB (little ones count!)

  3. #3
    Forum Expert shg's Avatar
    Join Date
    06-20-2007
    Location
    The Great State of Texas
    MS-Off Ver
    2003, 2010
    Posts
    40,678

    Re: Reselect cell after pressing enter

    If this is just for A2, then
    Please Login or Register  to view this content.
    (If it were for all cells, you'd just set MoveAfterEnter to False; and the only reason to calculate is if calculation is set to manual.)
    Entia non sunt multiplicanda sine necessitate

  4. #4
    Forum Contributor
    Join Date
    04-03-2009
    Location
    USA, California
    MS-Off Ver
    Excel 2007
    Posts
    385

    Re: Reselect cell after pressing enter

    Thanks, both work. And the reason that I want it to be told to calculate manually is all other sheets would also change to auto calc if I enabled auto calc. Some spreadsheets I use do alot of calculates and to auto calculate after every change would slow everything way down.

  5. #5
    Forum Expert JBeaucaire's Avatar
    Join Date
    03-21-2004
    Location
    Bakersfield, CA
    MS-Off Ver
    2010, 2016, Office 365
    Posts
    33,492

    Re: Reselect cell after pressing enter

    If that takes care of your need, please click EDIT in your original post, click GO ADVANCED and set the PREFIX box to SOLVED.

+ 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