Not move cell focus

What I am trying to do is not move focus from cell B30 (when employees are entering tunnel) and M30 (when employees are exiting the tunnel) after the user strikes ENTER.

Is there a way to do this with a formula?
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

Hi again :)

what do you exactly by 'not move focus'.  when i enter a number in B30 and press enter, it moves the person to the right and then selects B30 again.

What is the expected behavior?
I'm with FamousMortimer - the sheet as you have it seem to do what you ask using the Worksheet_change code you already have. A macro is the only way to do this - a formula can only return a result to the cell - it can't change focus.

The only other thing I'm aware of you can do is change the 'Excel Options..Advanced...Editing Options..After pressing enter move selection' to being unchecked.  This stops the focus changing after you hit enter, but it feels weird when you have it set, and it applies to everything in Excel.
cssc1Author Commented:
Sorry for not explaining myself correctly. I am thinks of the end users. They will be miners and will not be educated in the use of computers. They will be going into the mine to excavate material. They are assigned a number during signup and we need to keep track of who is in the mine. I plan on using only a large number pad and hving them "BANG" their number on the key pad to indicate they are in the mine. No mouse will be used.

So, I need the focus or curces to stay in B30 when they are entering their number.
Harry LeeCommented:
Have you try using protect sheet?

Basically what you do is to select B30 and do Format Cells. In the Protection tab, uncheck Locked, and click OK to close. Make sure you unlock only the B30.

Now protect the sheet but doing Alt-T, P, P. Or in Review menu, click Protect Sheet.
Now, in the popup box, Only keep Select Unlocked Cells option then click on.

Now the only cell you can go to is B30 on this sheet.

I think that's the only way you can lock the cell focus at the same place.

In your sample, both in and out activities are happening on the same sheet, and this is going to cause a problem. Since you can either unlock B30 or M30 so that the cell focus can stay at the same place.

Also, since your macro is check on both in and out activities, it's not going to work perfectly for you unless you have the upper section sitting on 1 sheet, and have a sheet for the In entry, and another for Out entry.

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Microsoft Excel

From novice to tech pro — start learning today.