Quantcast
Channel: Excel Help Forum - Excel Programming / VBA / Macros
Viewing all articles
Browse latest Browse all 49909

Run Time Error 13 Type Mismatch

$
0
0
Having problems with my code. It will work by itself but when I copy and paste data into the worksheet I get a run time error 13 type mismatch.



Private Sub Worksheet_Change(ByVal Target As Range)
If Target.Column = 1 Then
Application.EnableEvents = False
Select Case (Target.Value)
Case "Injected"
With Target.EntireRow
.Copy Destination:=Sheets("Injected").Range("A" & Rows.Count).End(xlUp).Offset(1)
.Delete
End With
Case "Too Expensive"
With Target.EntireRow
.Copy Destination:=Sheets("Too Expensive").Range("A" & Rows.Count).End(xlUp).Offset(1)
.Delete
End With
Case "Other"
With Target.EntireRow
.Copy Destination:=Sheets("Other").Range("A" & Rows.Count).End(xlUp).Offset(1)
.Delete
End With
End Select
Application.EnableEvents = True
End If
End Sub


The error is with the first case "Case Injected"


Code using to move to the worksheet with the above code.

Sub Copy()
'Sheet1 must have data in column D
Sheets("Data2").Range("A1:AY10000").Cut Destination:=Sheets("Check List").Range("D10000").End(xlUp).Offset(1, -3)


End Sub



Any help would be greatly appreciated.

Thanks

Viewing all articles
Browse latest Browse all 49909

Trending Articles