Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default How to code: If active cell is B1, goto H17 when enter pressed

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)
  #2   Report Post  
Posted to microsoft.public.excel.programming
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
  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11,058
Default How to code: If active cell is B1, goto H17 when enter pressed

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
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

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


Similar Threads
Thread Thread Starter Forum Replies Last Post
When enter key is pressed, cursor does not move to next cell in Ex Blackie Excel Discussion (Misc queries) 3 April 19th 23 02:10 PM
how do I change which cell becomes active when enter is pressed? scotpiper Excel Discussion (Misc queries) 1 April 7th 09 12:18 AM
Enter button jumps to next cell each time its pressed!!!! evasmagacz Excel Discussion (Misc queries) 3 June 17th 07 08:37 PM
Rounding up to nearest 10 when "Enter" is pressed or user has clickedoff the cell Maddoktor Excel Programming 2 January 16th 07 11:19 PM
Goto a named range using the contents of the active cell Brian C Excel Programming 1 June 14th 06 05:14 AM


All times are GMT +1. The time now is 03:44 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"