+ Reply to Thread
Results 1 to 10 of 10

Automatically Select Same Cell From the Previous Worksheet

  1. #1
    Registered User
    Join Date
    09-21-2015
    Location
    south carolin
    MS-Off Ver
    7
    Posts
    41

    Automatically Select Same Cell From the Previous Worksheet

    I need help with a macro that will automatically select the same cell from the previous worksheet. For example: on worksheet1 If I select A2, type data, then select Worksheet2, I would like A2 to be automatically selected.

  2. #2
    Valued Forum Contributor Neil_'s Avatar
    Join Date
    04-19-2013
    Location
    Yorkshire
    MS-Off Ver
    Office 365 Enterprise E3 2013 / 2016
    Posts
    479

    Re: Automatically Select Same Cell From the Previous Worksheet

    Air code (untested)
    Please Login or Register  to view this content.
    Frob first, tweak later

  3. #3
    Valued Forum Contributor Neil_'s Avatar
    Join Date
    04-19-2013
    Location
    Yorkshire
    MS-Off Ver
    Office 365 Enterprise E3 2013 / 2016
    Posts
    479

    Re: Automatically Select Same Cell From the Previous Worksheet

    Didn't work, lol.
    Fixed
    Please Login or Register  to view this content.
    Last edited by Neil_; 09-13-2016 at 10:03 AM.

  4. #4
    Registered User
    Join Date
    09-21-2015
    Location
    south carolin
    MS-Off Ver
    7
    Posts
    41

    Re: Automatically Select Same Cell From the Previous Worksheet

    Quote Originally Posted by Neil_ View Post
    Didn't work, lol.
    Fixed
    Please Login or Register  to view this content.
    Thanks Neil.

    Where are you putting this code. On the worksheet tab under view code?

  5. #5
    Valued Forum Contributor Neil_'s Avatar
    Join Date
    04-19-2013
    Location
    Yorkshire
    MS-Off Ver
    Office 365 Enterprise E3 2013 / 2016
    Posts
    479

    Re: Automatically Select Same Cell From the Previous Worksheet

    It depends.
    that will automatically select the same cell from the previous worksheet
    Automatically. When? and for every sheet? It will be like falling down a well if so.

  6. #6
    Registered User
    Join Date
    09-21-2015
    Location
    south carolin
    MS-Off Ver
    7
    Posts
    41

    Re: Automatically Select Same Cell From the Previous Worksheet

    Quote Originally Posted by Neil_ View Post
    It depends.

    Automatically. When? and for every sheet? It will be like falling down a well if so.
    I'm using 4 different worksheets that are setup almost identical but will have different values in the cells. Once I enter data into worksheet 1 I will move to worksheet 2 then 3 and 4. So if there is no way to have excel automatically select the last cell used in the previous sheet, They could all change to the last cell I used in sheet1. Sorry if I'm being confusing and thanks again for your help.

  7. #7
    Valued Forum Contributor Neil_'s Avatar
    Join Date
    04-19-2013
    Location
    Yorkshire
    MS-Off Ver
    Office 365 Enterprise E3 2013 / 2016
    Posts
    479

    Re: Automatically Select Same Cell From the Previous Worksheet

    Hit F11, Insert> Module. in this new module Type this code:-
    Please Login or Register  to view this content.
    In the 'ThisWorbook' Module, paste this code.
    Please Login or Register  to view this content.
    When you change sheets by clicking on the tab, the selection of the previous sheet will be selected on the next one.

    Edit: Added a line to initialize global.
    Last edited by Neil_; 09-13-2016 at 11:33 AM.

  8. #8
    Registered User
    Join Date
    09-21-2015
    Location
    south carolin
    MS-Off Ver
    7
    Posts
    41

    Re: Automatically Select Same Cell From the Previous Worksheet

    Works perfectly! Thanks!

  9. #9
    Registered User
    Join Date
    09-21-2015
    Location
    south carolin
    MS-Off Ver
    7
    Posts
    41

    Re: Automatically Select Same Cell From the Previous Worksheet

    Quote Originally Posted by Neil_ View Post
    Hit F11, Insert> Module. in this new module Type this code:-
    Please Login or Register  to view this content.
    In the 'ThisWorbook' Module, paste this code.
    Please Login or Register  to view this content.
    When you change sheets by clicking on the tab, the selection of the previous sheet will be selected on the next one.

    Edit: Added a line to initialize global.
    Out of curiosity I made another worksheet and setup a chart. Since there is no cell to actually select, I'm getting an error message. Occasionally I need to use a chart. Is there anyway to disable the macro on certain sheets or in particular a sheet that is just a chart?

    EDIT: Never mind I just added a line to ignore the error
    Last edited by pick-six; 09-13-2016 at 12:06 PM.

  10. #10
    Forum Expert nilem's Avatar
    Join Date
    10-22-2011
    Location
    Ufa, Russia
    MS-Off Ver
    2013
    Posts
    3,377

    Re: Automatically Select Same Cell From the Previous Worksheet

    or maybe so
    Please Login or Register  to view this content.

+ 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] How do I automatically fill a new worksheet with a previous worksheets data and formula?
    By daughty in forum Excel Programming / VBA / Macros
    Replies: 9
    Last Post: 12-10-2015, 11:40 AM
  2. VBA to select the previous visible cell
    By shiva_reshs in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 08-05-2014, 09:27 AM
  3. Can Excel automatically add 1 to previous cell until # is reached?
    By todd774 in forum Excel Formulas & Functions
    Replies: 14
    Last Post: 06-10-2013, 05:01 PM
  4. Select previous cell using macro
    By DJGodders in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 12-05-2012, 11:18 AM
  5. VBA Select Previous Cell + Current
    By tpowell55 in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 06-30-2010, 01:05 PM
  6. How to add Accumilative + daily cost value from the previous worksheet automatically
    By uaeXXuae in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 05-09-2009, 08:55 AM
  7. Replies: 1
    Last Post: 12-30-2005, 09:35 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