Refining code to prevent run-time error 13 for Private sub

Laurence D

New Member
Joined
Sep 14, 2016
Messages
31
Hi there,

Can somebody please help me refine my code so that when I delete cells in column C and D at the same time that I will not produce a run-time error 13 mismatch. Just because I have six other people using this sub and they have zero knowledge or VBA or resetting a sub.

For context the rest of my code will auto-populate the same row in column D when a value is entered into column C.

Code:
   If Target.CountLarge > 3 Then Exit Sub 
   If Target.Column <> 3 Then Exit Sub 
   If Len(Target.Value) = 0 Then Exit Sub

I tried adding this code to no avail:
Code:
   If Len(Target.Value) = 0 And Len(Target.Offset(, 1).Value) = 0 Then Exit Sub

Thanks,
Laurence
 

Excel Facts

What is =ROMAN(40) in Excel?
The Roman numeral for 40 is XL. Bill "MrExcel" Jelen's 40th book was called MrExcel XL.
I assume that this is part of some Event Procedure code. Which Event Procedure is it?
Better yet, can you post the whole code?

Note that this might work (depending on what you are trying to actually accomplish with your code).
Code:
[FONT=Verdana]If Target.CountLarge >[COLOR=#ff0000] 1[/COLOR] Then Exit Sub[/FONT]
 
Upvote 0

Forum statistics

Threads
1,214,826
Messages
6,121,795
Members
449,048
Latest member
greyangel23

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