Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
DiscussionsAccessExcelInfoPathOutlookPowerPointPublisherWord
DirectoryUser Groups
Related Topics
Outlook ExpressInternet ExplorerWindowsMS Server ProductsMore Topics ...

MS Office Forum / Excel / Programming / November 2007

Tip: Looking for answers? Try searching our database.

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

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
GregBeam - 26 Nov 2007 02:55 GMT
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)
trevosef@gmail.com - 26 Nov 2007 05:51 GMT
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
Gary''s Student - 26 Nov 2007 10:00 GMT
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
Signature

Gary''s Student - gsnu200758

> 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)
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.