go back to active cell after running macro

anxoperez

Active Member
Joined
Oct 3, 2007
Messages
254
Does anyone know how to automatically go back to the cell I was working on (meaning, the cell I last worked on) before I run a macro?

thanks
 

Excel Facts

Convert text numbers to real numbers
Select a column containing text numbers. Press Alt+D E F to quickly convert text to numbers. Faster than "Convert to Number"
you can try something like this...

put this at the beginning of your macro
Code:
Set rng = ActiveCell

put this at the end of your macro

Code:
Application.Goto rng
 
Upvote 0
Does anyone know how to automatically go back to the cell I was working on (meaning, the cell I last worked on) before I run a macro?

thanks

There's usually no need to select other cells/ranges/sheets when making changes to them via code.
 
Upvote 0
I thought I could help you with your post number 2600, but I'll have to leave you with 2599. Your explanation worked beautifully.

thanks
 
Upvote 0
anxoperez,
While Nooch seems to have you back under way, njimack makes a good point.
Depending on what your code is doing, there's a 99% (+) chance that the active cell never needs to be left in the first place. And, (again, depending on your code) it will run a lot faster/more efficiently if you don't.
 
Upvote 0
Sorry. I am afraid I can't understand what you guys mean.

Could you explain in further detail?

thanks
 
Upvote 0

Forum statistics

Threads
1,213,536
Messages
6,114,208
Members
448,554
Latest member
Gleisner2

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top