View Single Post
  #5   Report Post  
Posted to microsoft.public.excel.programming
Patrick Molloy[_2_] Patrick Molloy[_2_] is offline
external usenet poster
 
Posts: 1,298
Default set cursor position after cell is populated??

in addition to my prev posting which just stopped the movement, you could use
the change event to control it ...here's some code that offers you some
ideas. right click the sheet tab and select View Code, then paste this:
Option Explicit

Private Sub Worksheet_Change(ByVal Target As Range)

If Target.Count = 1 Then
If Target.Column = 3 Then
Select Case Target.Value
Case Is < 10
Range("B3").Select
Case 11
Worksheets("sheet2").Activate
Worksheets("sheet2").Range("C5").Select
Case 14, 21, 28
Range("A7:D7").Select
Case Else
' do nothing
End Select

End If

End If


End Sub

"Robert Crandal" wrote:

If a user enters an integer value into say cell A1 and then presses the
Enter key, the cursor (or "active cell") will instantly move one cell
downwards, which I think is Excel's default behavior on spreadsheets.

Can I change this behavior using Visual Basic?? Basically, after a user
enters a value into an arbitrary cell and then presses the Enter key, I
would
like to program Excel to move the cursor or "active cell" to a cell of my
choice.

I hope this question makes sense. Please advise!

Thank you!


.