I need to know how to stop the Excel Cursor from moving down one cell after a click selection. I turned OFF the cursor move selection after pressing Enter int he Advanced features function under Excel options. But I am NOT using the Enter button, I am using the click feature of the mouse. So how so I stop this from happening??
I am using a SelectionChange trap in VB to trap the cell location and then if ti is within my cell restraints, I am allowing a calendar to popup and when the date is selected, the cursor should just unactivate in a cell period is what I am ultimately after. I do NOT want the date popup to show up again when the cursor moves down to the next cell at all. Here is my code. I went back to the double click to get the cursor to quit moving around. But I really want to have just one click select liek the commented code does. Cursor movement is the issue here.
Private Sub Worksheet_BeforeDoubleClick(ByVal Target As Range, Cancel As Boolean)
If ((Target.Row >= 6 And Target.Column = 7) Or (Target.Row >= 6 And Target.Column = 8) Or (Target.Row >= 6 And Target.Column = 9)) Then
frmCalendar.Show
End If
End Sub
' I prefer this code to be used but the cusror moves to the next field when this is used.
'Private Sub Worksheet_SelectionChange(ByVal Target As Range)
'If ((ActiveCell.Row >= 6 And ActiveCell.Column = 7) Or (ActiveCell.Row >= 6 And ActiveCell.Column = 8) Or (ActiveCell.Row >= 6 And ActiveCell.Column = 9)) Then
' frmCalendar.Show
'End If
'End Sub
Bookmarks