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?
Harry LeeConnect With a Mentor Commented:
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.
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.
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.