Tabbing in a form from field to field

T

Tom S.

I've set up a form. I want to tab from data input cell
to data input cell. The cells are not right together. I
can do this in 2002 by protecting/locking all the non-
data cells; then, the tab (or cursor) moves to the next
unprotected cell.
But I want to use this in prior versions of Excel. It
seems that in those versions (2000, 97), the cursor or
tab will go to protected cells, but the paper clip opens
up and tells me that the cell is protected. How can I
just tab to the next cell?
 
R

Ron de Bruin

Hi Tom

You can protect your sheets with code like this
You can only select cells with locked =false now


Right click on the Excel icon next to File in the menubar
And choose View code

You are now in the Thisworkbook module
Paste the Event in this place
Alt-Q to go back to Excel
Save your file and close it

When you open the file again you can only select unprotected cells

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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top