Auto goto after CR

  • Thread starter Thread starter Mike Gill
  • Start date Start date
You can't. You can specify only up, down, left, or right, not a
specific cell.


--
Cordially,
Chip Pearson
Microsoft MVP - Excel
Pearson Software Consulting, LLC
www.cpearson.com
 
Is it possible with vba.


Chip Pearson said:
You can't. You can specify only up, down, left, or right, not a
specific cell.


--
Cordially,
Chip Pearson
Microsoft MVP - Excel
Pearson Software Consulting, LLC
www.cpearson.com
 
Hi Mike,

The answer is yes. Try putting this into a standard module (e.g. Module1):

Sub ModifyEnter_NumericKeypad()
Application.OnKey "{ENTER}", "SelectCell"
End Sub

Sub ModifyEnter()
Application.OnKey "~", "SelectCell"
End Sub

Sub ReleaseEnterKeys()
Application.OnKey "{ENTER}"
Application.OnKey "~"
End Sub

Sub SelectCell()
ActiveSheet.Range("A1").Select
End Sub

Regards,
KL
 
Thanks will try.
MG


KL said:
Hi Mike,

The answer is yes. Try putting this into a standard module (e.g. Module1):

Sub ModifyEnter_NumericKeypad()
Application.OnKey "{ENTER}", "SelectCell"
End Sub

Sub ModifyEnter()
Application.OnKey "~", "SelectCell"
End Sub

Sub ReleaseEnterKeys()
Application.OnKey "{ENTER}"
Application.OnKey "~"
End Sub

Sub SelectCell()
ActiveSheet.Range("A1").Select
End Sub

Regards,
KL
 
Mike

This may be a little easier. Adjust and add more cells as needed.

Private Sub Worksheet_Change(ByVal Target As Range)
Select Case Target.Address
Case "$C$2"
Range("C5").Select
Case "$C$5"
Range("E2").Select
Case "$E$2"
Range("E5").Select
End Select
End Sub

This is worksheet event code. Right-click on the sheet tab and "View Code".

Paste the above in there.


Gord Dibben Excel MVP
 

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