run macro after pressing enter

y481184

Board Regular
Joined
Aug 1, 2003
Messages
137
Is there a way to get a macro to run after pressing enter upon completion of a particular cell? I have 6 cells that collectively (along with several if statements) determine the output that will be placed in a different cell on the worksheet. I would like the macro to fire when the user presses enter or tabs past the last cell needed to complete the calculation. I hope this is clear, can anyone help?
 

Excel Facts

Best way to learn Power Query?
Read M is for (Data) Monkey book by Ken Puls and Miguel Escobar. It is the complete guide to Power Query.
Sure. You can use a Worksheet_SelectionChange event to determine when to fire your code. Do a search on this board for this event, or look in the VB help documentation for more information.
 
Upvote 0
TommyGun is right.
However if you have your "Move selection after enter" option disabled (Tools > Options > Edit tab) then I think you'll need a copy of your macro in a Worksheet_Change sub also to get it to fire when Enter is pressed.

Dan
 
Upvote 0

Forum statistics

Threads
1,214,520
Messages
6,120,017
Members
448,937
Latest member
BeerMan23

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