How to automatically jump to neighboring cell as active cell?

  • Thread starter Thread starter AA Arens
  • Start date Start date
A

AA Arens

I do have three columns where as the first two are combo.

I want that after choosing the value, the neighboring cell, for the
second combo is activated (selected). And after that, the thrird cell
is activated. How to perform in VB, and for 50 rows together?

Should be something like:
Cells(7, ActiveCell.Row?).Select




For your info, I do have rthis code at the moment, but that's per row
(till row C50).

If Not Intersect(Target, Me.Range("C07")) Is Nothing Then
If Target.Count > 1 Then Exit Sub
Application.EnableEvents = False
Set rng = ActiveWorkbook.Names(Target.Value).RefersToRange
Me.Range("D07").Value = rng.Offset(0, 0).Value
End If
 
I do actually have more than 3 colomn and want to apply the move to the
neighboring column only to the first two columns, so:


A = combo B = combo C /D etc normal columns
jump to B jump to C no jump


After a newsgroup search and the Help section, I was playing with

Worksheets("Forest").Activate
ActiveCell.Offset(rowOffset:=0, columnOffset:=1).Activate

and with RANGE

But couldn't find it out. How to limit it to the first 2 columns?
 
Hi,

This is worksheet code so you place it in the code for the worksheet.

Private Sub Worksheet_Change(ByVal Target As Range)
If Target.Column < 3 and target.row < 51 _
Then Target.Offset(0, 1).Activate
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

Back
Top