Re: How do I move to a specific cell in Excel?



Do you mean if user enters P or S in C1 you want a certain number of cells to
become available for data entry depending upon value of C1?

If they enter P or S in C2 or C3 or C4 etc. another set of cells becomes
available for data entry?

Possible............yes.

Complex............yes and possibly stretching my limited coding skills.

So far you are the only person who knows what Tab order sequence you need and
which cells would become available for each P or S in whatever cell is selected
in column C.


Gord

On Tue, 6 Mar 2007 08:49:28 -0800, JAConnolly
<JAConnolly@xxxxxxxxxxxxxxxxxxxxxxxxx> wrote:

If they enter S or P in Column C, then I want them to tab to specific cells
in sequence for data entry. Is this possible?

"Gord Dibben" wrote:

Private Sub Worksheet_Change(ByVal Target As Range)
If Target.Cells.Column <> 1 Then Exit Sub
On Error GoTo endit
Application.EnableEvents = False
Select Case LCase(Target.Value)
Case "S"
Target.Offset(0, 2).Select
Case "P"
Target.Offset(0, 5).Select
End Select
endit:
Application.EnableEvents = True
End Sub


Gord

On Mon, 5 Mar 2007 06:29:05 -0800, JAConnolly
<JAConnolly@xxxxxxxxxxxxxxxxxxxxxxxxx> wrote:

Thank you. This did work for me. I know nothing about codes. Is it
possible for it to be applied to an entire column rather than a single cell?
If that same column has a different letter such as S or P, I want it to move
to a different cell, is that possible?

"Gord Dibben" wrote:

Cannot be done based upon a cell value without using VBA event code.

Formulas can only return calculated results, not move the cursor.

This event code will do the trick. Enter a or A in C4 and hit ENTER or Tab key
to jump to E4.

Private Sub Worksheet_Change(ByVal Target As Range)
If Target.Cells.Count > 1 Then Exit Sub
If Intersect(Target, Me.Range("C4")) Is Nothing Then Exit Sub
On Error GoTo CleanUp
Application.EnableEvents = False
With Target
If LCase(.Value) = "a" Then
.Offset(0, 2).Select
End If
End With
CleanUp:
Application.EnableEvents = True
End Sub

Right-click on the sheet tab and "View Code". Copy/paste the code into that
sheet module.


Gord Dibben MS Excel MVP

On Fri, 2 Mar 2007 15:19:45 -0800, JAConnolly
<JAConnolly@xxxxxxxxxxxxxxxxxxxxxxxxx> wrote:

How do I move to a specific cell in Excel?

For Example: If C4 = A then move to E4 using the tab key






.