PC Review


Reply
Thread Tools Rate Thread

How to code: If active cell is B1, goto H17 when enter pressed

 
 
GregBeam
Guest
Posts: n/a
 
      26th Nov 2007
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)
 
Reply With Quote
 
 
 
 
trevosef@gmail.com
Guest
Posts: n/a
 
      26th Nov 2007
On Nov 26, 10:55 am, GregBeam <GregB...@discussions.microsoft.com>
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
 
Reply With Quote
 
Gary''s Student
Guest
Posts: n/a
 
      26th Nov 2007
Private Sub Worksheet_Change(ByVal Target As Range)
If Intersect(Range("B1"), Target) Is Nothing Then Exit Sub
Application.EnableEvents = False
Range("H17").Select
Application.EnableEvents = True
End Sub
--
Gary''s Student - gsnu200758


"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)

 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
how do I change which cell becomes active when enter is pressed? scotpiper Microsoft Excel Misc 1 7th Apr 2009 12:18 AM
When enter key is pressed, cursor does not move to next cell in Ex Blackie Microsoft Excel Misc 2 20th Mar 2009 05:40 AM
Enter button jumps to next cell each time its pressed!!!! =?Utf-8?B?ZXZhc21hZ2Fjeg==?= Microsoft Excel Misc 3 17th Jun 2007 08:37 PM
Code to make Combo act like arrow has been pressed on Enter proper =?Utf-8?B?RGlydGJpa2U=?= Microsoft Access Form Coding 1 13th Sep 2006 02:28 PM
userform to enter data - needs to goto next blank cell deanimate Microsoft Excel Worksheet Functions 2 22nd Jan 2004 01:25 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 02:04 PM.