VBA cut and paste
I think you will have to use Target rather than Selection and ActiveCell...
since this is in the Change event, I believe the ActiveCell has moved on to
another cell (in accordance with your Option setting) when you keyed in the
Enter key.
--
Rick (MVP - Excel)
"JSnow" wrote in message
...
I'm using Excel 2003 and want to move data from a cell in column C to
column
D (same row) if the data starts with a six. Here's my code thus far:
Private Sub Worksheet_Change(ByVal Target As Range)
Application.EnableEvents = False
On Error GoTo Whoops
If Target.Column = 3 Then 'column C
If Target.Row 1 Then 'ignore row 1
Dim LResult As String
LResult = Left(Target.Value, 1)
If LResult = "6" Then
Selection.Cut
ActiveCell.Offset(0, 1).Select
ActiveSheet.Paste
End If
End If
End If
Whoops:
Application.EnableEvents = True
End Sub
Nothing happens. The sheet just sits there and mocks me.
|