Run time error when copy pasting data

ssbhatban

Board Regular
Joined
Oct 20, 2015
Messages
81
Office Version
  1. 2010
Platform
  1. Windows
Dear friends
I have created a sheet for database containing macro which also does data validation for blank cells. It is working fine when I am doing manual entry. But when I do copy paste from another sheet it gives runtime error ' type mismatch 13, end or debug option'
I need to do copy paste as it is not possible to enter manually. I am using ' change by value' process for work sheet
Is there any vba code to over come problem
Thanks
 

Excel Facts

Ambidextrous Undo
Undo last command with Ctrl+Z or Alt+Backspace. If you use the Undo icon in the QAT, open the drop-down arrow to undo up to 100 steps.
what is the macro you use for validating, is it triggered when you paste the data ?
 
Upvote 0
what is the macro you use for validating, is it triggered when you paste the data ?

dear friend

I am using this code to delete value in next columns if the column B is blank

Private Sub Worksheet_Change(ByVal Target As Range)

' If target column is B, ( Name ) is below the header row AND it's new value is blank then clear (Reg. no) C...
If Target.Column = 2 And Target.Row > 1 And Target.Value = "" Then
' Clear contents of column C
Target.Offset(0, 1).ClearContents
End If

and also i am making sure that column B is entered before column C is entred
If Target.Count > 1 Then Exit Sub
If Target.Value <> "" Then
If Not Intersect(Target, Range("C:C")) Is Nothing Then
If Target.Offset(, -1).Value = "" Then
Target.Value = ""
MsgBox " Enter Name "
Target.Offset(, -1).Select
End If
End If
End If

every thing is working fine when i am entering manually. but when i copy from other sheets i am getting error. even i a getting " run time error - 13 , type mis match " when i selec more that one data in the same column & deleted. is there any way to send the screen shot to you?
 
Upvote 0
dear friend

I am using this code to delete value in next columns if the column B is blank

Private Sub Worksheet_Change(ByVal Target As Range)

' If target column is B, ( Name ) is below the header row AND it's new value is blank then clear (Reg. no) C...
If Target.Column = 2 And Target.Row > 1 And Target.Value = "" Then
' Clear contents of column C
Target.Offset(0, 1).ClearContents
End If

and also i am making sure that column B is entered before column C is entred
If Target.Count > 1 Then Exit Sub
If Target.Value <> "" Then
If Not Intersect(Target, Range("C:C")) Is Nothing Then
If Target.Offset(, -1).Value = "" Then
Target.Value = ""
MsgBox " Enter Name "
Target.Offset(, -1).Select
End If
End If
End If

every thing is working fine when i am entering manually. but when i copy from other sheets i am getting error. even i a getting " run time error - 13 , type mis match " when i selec more that one data in the same column & deleted. is there any way to send the screen shot to you?

Hi solved thanks
 
Upvote 0

Forum statistics

Threads
1,214,405
Messages
6,119,323
Members
448,887
Latest member
AirOliver

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