Force range select when enter key pressed

pacoonejr

Board Regular
Joined
Apr 19, 2003
Messages
138
Howdy all,

I have a sheet that is locked except for 1 cell. you enter a value and every thing changes. now when they enter the value i want the curser back in cell A1. I just cant figure this out.

Thanks,
 

Excel Facts

What is the shortcut key for Format Selection?
Ctrl+1 (the number one) will open the Format dialog for whatever is selected.

HalfAce

MrExcel MVP
Joined
Apr 6, 2003
Messages
9,456
If that one cell were (for example) D50, you might try:
Code:
Private Sub Worksheet_Change(ByVal Target As Range)
If Target.Address = "$D$50" Then [A1].Select
End Sub
You will need to incorporate this into the existing worksheet change event if that's what you're using to make all the other changes. If those happen purely through formula calculations, then this is all you should need in the sheet module.

Hope it helps,
Dan
 

jdc

Active Member
Joined
Nov 23, 2004
Messages
263
Hi,

Just another option to play with, you could lock all cells and using the Control Toolbox, select the whole sheet and set the "EnableSelection" option to "1 - xlUnlockedCells" only and then reprotect the sheet, the cursor won't be able to move from there then.

John
 

Forum statistics

Threads
1,148,526
Messages
5,747,211
Members
424,068
Latest member
Salim khamis

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
Top