how do I put my unprotected cells in order to answer they're mixed

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I have created a form and unlocked certain cells. I want my users to
progress through my form in a certain order, but when I protect the page and
push the enter button it jump around in what ever order excel wants. Help!!!
I know there is a way to order them but forget how to do it.
 
Penny,
Excel doesn't jump around, it would follow the setting of
Tools>Options>Edit>Move Selection after enter, within the unlocked cells.
Maybe changing that will give you the correct order.
If you really want to jump around in an essentially random order, set the ID
of each unlocked cell before protecting the sheet to point to the next cell.
You only need to do this once. AFAIK there's no way to set this without
code. This means you cannot use the sheet with cell IDs for a web page, but
may not be a problem.
You should add error trapping .

Dim PrevRange As Range

Private Sub CommandButton1_Click()
Range("C3").ID = "F9"
Range("F9").ID = "D5"
Range("D5").ID = "E3"
Range("E3").ID = "C8"
Range("C8").ID = "C3"
End Sub

Private Sub Worksheet_SelectionChange(ByVal Target As Range)

If Not PrevRange Is Nothing Then
Application.EnableEvents = False
Range(PrevRange.ID).Select
Application.EnableEvents = True
End If

Set PrevRange = ActiveCell

End Sub

NickHK
 

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

Back
Top