PDA

View Full Version : VBA code for Cursor to stay Stationary in one cell



aacod
08-09-2012, 05:42 AM
I need a VBA code for one particular workbook to do the following on Sheet 1 named Acronym Lookup, using Excel 2007 and Excel 2010.



I want the cursor to stay in cell B4 on hitting ENTER, so that I can again enter data in cell B4.

Bob Phillips
08-09-2012, 05:43 AM
Lock all cells except B4, then protect the worksheet.

aacod
08-09-2012, 06:02 AM
xld,

I did the following:

Selected cell B4, right clicked on it, selected format cells, selected protection tab and unchecked locked and hidden.

Clicked on Review, and procted the sheet.
On entering data and hitting ENTER the cursor still moves down to cell B5.

I want it to stay at cell B4 only, so that I can enter new data without hitting the up arrow.

I tried going to Excel options, selected Advanced and unchecked the option for cursor movement, but that affects the excel application in general and all other workbooks.

Aflatoon
08-09-2012, 06:14 AM
When you protect the sheet uncheck the option to select locked cells.

aacod
08-09-2012, 06:28 AM
Thanks xld and Aflatoon, WORKS. GREAT!