View Single Post
  #20   Report Post  
Posted to microsoft.public.excel.programming
Rick Rothstein Rick Rothstein is offline
external usenet poster
 
Posts: 5,934
Default VBA cut and paste

I'm guessing your two messages together are saying you do not have that
option checked. That would be why the OP's code works for you, but not for
me (I have the option checked). For you, the ActiveCell remains as the
Target cell after editing is complete... for me (and a lot of others out
there I would guess), the ActiveCell moves with the completion of editing
meaning that the ActiveCell is not the same as the Change event's Target
cell.

--
Rick (MVP - Excel)


"Don Guillett" wrote in message
...

UN

--
Don Guillett
Microsoft MVP Excel
SalesAid Software

"Don Guillett" wrote in message
...
Rick, I ALWAYS have that box checked.

--
Don Guillett
Microsoft MVP Excel
SalesAid Software

"Rick Rothstein" wrote in message
...
I am also using XL2003 on Vista (Ultimate edition though, but that
shouldn't matter). Do you have the "Move selection after Enter" checkbox
unchecked on the Tools/Options/Edit(tab) dialog? That would be the only
way I can see the OP's code working for you.

--
Rick (MVP - Excel)


"Don Guillett" wrote in message
...
Rick, I just retested it and it worked as he had it written.
xl2003 vista HP


--
Don Guillett
Microsoft MVP Excel
SalesAid Software

"Rick Rothstein" wrote in message
...
It didn't work for me.

--
Rick (MVP - Excel)


"Don Guillett" wrote in message
...

I tested your code and it worked

--
Don Guillett
Microsoft MVP Excel
SalesAid Software

"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.