ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Go to SELECTED CELLS (https://www.excelbanter.com/excel-programming/294494-go-selected-cells.html)

Danny[_4_]

Go to SELECTED CELLS
 
Is there a macro command that would enable a user to jump
to a selected cell?

I have a form with 18 cells to fill up. Lets say A1, B2,
C3, F4, etc.

If the user fills in A1 and press enter or, if the active
cell is A1 and the user uses the tab, it will go to B2 and
so on.

Is this possible?

jeff

Go to SELECTED CELLS
 
Try this macro

Private Sub Worksheet_Change(ByVal Target As Range
If Target.Address = "$A$1" Then Range("B6").Selec
If Target.Address = "$B$6" Then Range("C1").Selec
If Target.Address = "$C$1" Then Range("A1").Selec
End Sub

DAnny

Go to SELECTED CELLS
 
Thanks! It works when you fill up the cell and press
enter. However, if you press tab, it goes to a "non"
selected cell (between selected cells).

-----Original Message-----
Try this macro:

Private Sub Worksheet_Change(ByVal Target As Range)
If Target.Address = "$A$1" Then Range("B6").Select
If Target.Address = "$B$6" Then Range("C1").Select
If Target.Address = "$C$1" Then Range("A1").Select
End Sub
.


DAnny

Go to SELECTED CELLS
 
I figured it out. The "non" selected cells were
unprotected. Now it's working perfectly.

-----Original Message-----
Try this macro:

Private Sub Worksheet_Change(ByVal Target As Range)
If Target.Address = "$A$1" Then Range("B6").Select
If Target.Address = "$B$6" Then Range("C1").Select
If Target.Address = "$C$1" Then Range("A1").Select
End Sub
.



All times are GMT +1. The time now is 10:39 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com