View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
[email protected] trevosef@gmail.com is offline
external usenet poster
 
Posts: 14
Default How to code: If active cell is B1, goto H17 when enter pressed

On Nov 26, 10:55 am, GregBeam
wrote:
When the active cell is B1, I want the curser to move to cell H17 when press
enter. I need the VB code to do this (or a macro)


Hi GregBeam,

The code below should be copied to the specific sheet to work. It
will automatically move to cell H17 if the active cell is B1. Don't
have to press Enter key.

Private Sub Worksheet_SelectionChange(ByVal Target As Range)
If ActiveCell.Address = "$B$2" Then
Application.Goto Range("H17")
End If
End Sub

Regards
trevosef