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.
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.
Air code (untested)
Please Login or Register to view this content.
Frob first, tweak later
Didn't work, lol.
Fixed
Please Login or Register to view this content.
Last edited by Neil_; 09-13-2016 at 10:03 AM.
It depends.
Automatically. When? and for every sheet? It will be like falling down a well if so.that will automatically select the same cell from the previous worksheet
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.
Hit F11, Insert> Module. in this new module Type this code:-
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.Please Login or Register to view this content.
Edit: Added a line to initialize global.
Last edited by Neil_; 09-13-2016 at 11:33 AM.
Works perfectly! Thanks!
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.
or maybe so
Please Login or Register to view this content.
There are currently 1 users browsing this thread. (0 members and 1 guests)
Bookmarks