Delete cut line has me stumped !!!!

MasterChief

Board Regular
Joined
Feb 14, 2006
Messages
172
I use the following code which works great, however it will not delete the line after it has been cut? Any ideas please.

Private Sub Worksheet_Change(ByVal Target As Range)
Application.EnableEvents = False
If Target.Column = 1 Then
If Target.Value = 3 Then
Target.EntireRow.Cut Destination:=Sheets("Sheet2"). _
Range("A" & Rows.Count).End(xlUp).Offset(1)
Target.EntireRow.Delete
End If
End If
Application.EnableEvents = True
End Sub
 

Excel Facts

Does the VLOOKUP table have to be sorted?
No! when you are using an exact match, the VLOOKUP table can be in any order. Best-selling items at the top is actually the best.
Code:
Private Sub Worksheet_Change(ByVal Target As Range)    Application.EnableEvents = False
        If Target.Column = 1 Then
            If Target.Value = 3 Then
                Sheets("Sheet2").Range("A" & Rows.Count).End(xlUp).Offset(1).Value = Target.EntireRow.Formula
                Target.EntireRow.Delete
            End If
        End If
    Application.EnableEvents = True
End Sub

Maybe try this and see if it works? I'm not sure it will since I don't normally cross "value" and "formula". If it hangs up on that, you can change the ".formula" into ".value" and it might work. I know it's a different way at doing things, but it might help diagnose the problem.
 
Upvote 0

Forum statistics

Threads
1,215,566
Messages
6,125,593
Members
449,237
Latest member
Chase S

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top