Run-time error 13 in VBA

S0ph1e

New Member
Joined
Dec 13, 2023
Messages
8
Office Version
  1. 365
Platform
  1. Windows
I am very new to coding in excel so have no idea how to resolve my error message.

I have used the below code to create a multi selection drop down list. When I go to create a new row in the work sheet, I get the error message: Run-time error "13" Type mismatch.

1704374792949.png

Excel highlights where the error is but i have no idea how to correct it! Please help :(
 

Excel Facts

Will the fill handle fill 1, 2, 3?
Yes! Type 1 in a cell. Hold down Ctrl while you drag the fill handle.
Weird.. Could you please try:
VBA Code:
Else: If IsEmpty(Target.Value) Then GoTo Exitsub Else
 
Upvote 0
If you insert a row, Target is the entire row, and you can't compare an array of values using =

You could add:

Code:
If Target.Countlarge > 1 then exit sub
 
Last edited by a moderator:
Upvote 0
Solution
Weird.. Could you please try:
VBA Code:
Else: If IsEmpty(Target.Value) Then GoTo Exitsub Else
I tired this and it flagged up an error further on in the code. I have the solution now but I really appreciate your suggestion :)
 
Upvote 0
If you insert a row, Target is the entire row, and you can't compare an array of values using =

You could add:

Code:
If Target.Countlarge > 1 then exit sub
This worked! Thank you :)
 
Upvote 0
Glad we could help. :)
 
Upvote 0

Forum statistics

Threads
1,215,108
Messages
6,123,131
Members
449,097
Latest member
mlckr

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