Tabs

L

Lynn

If I'm making a questionnaire in excel and the first response goes in cell
A2, then the next answer goes in cell B3. Is there a way to have the cursor
move to B3 without actually hitting tab?

Thanks,
Lynn
 
R

Ron de Bruin

Hi Lynn

You can use this code in the workbook open event.
Try this on a example workbook

Uncheck the locked property of all cells you want to use first
Select the cells
Ctrl-1
On the Protection tab uncheck locked

Right click on the Excel icon next to File in the Worksheet menu bar
Choose view code
Paste this event there
Alt-q to go back to Excel
Save/close/reopen the workbook

When you open the file you only can select unlocked cells
in each sheet.

Private Sub Workbook_Open()
Dim Sh As Worksheet
Application.ScreenUpdating = False
For Each Sh In ThisWorkbook.Worksheets
Sh.Select
Sh.Protect userinterfaceonly:=True
Sh.EnableSelection = xlUnlockedCells
Next
Sheets(1).Select
Application.ScreenUpdating = True
End Sub
 
G

Gord Dibben

Lyn

Another VBA method if you don't want to protect the sheet or cells.

Private Sub Worksheet_Change(ByVal Target As Range)
Select Case Target.Address
Case "$A$2"
Range("B3").Select
Case "$B$3"
Range("E2").Select
Case "$E$2"
Range("E5").Select
'add as many cases as you wish
End Select
End Sub

When you hit <Enter> key in A2 the cursor will jump to B3 and etc.

This code would be entered in the Worksheet module.

Click on sheet tab and "View Code". Copy/paste the code in there.


Gord Dibben Excel MVP
 
G

Gord Dibben

Marthaq

These are not formulas.

The code is event code and runs when you select a cell, enter something then
hit ENTER key.

Yes, it would work in 2003 also.


Gord Dibben Excel MVP
 
Top