VBA UserForm ComboBox Returns Type 13 Error with Formula Value, Works With Integer, Help!

csrichankij

New Member
Joined
Sep 30, 2015
Messages
1
Hello, I've been at this for 2 days, would love to know the answer.

I have a combo box in a user form which returns a list of concatenated names. Based on the value the rest of this combobox the form is suppose to fill in the other values from the same sheet. When I run the code it returns a "type 13 mismatch".

I'm attempting to modify code originally was intended for a range with integers. Got it from a YouTube video (
).

Here is the code (as designed for integer, not my concatenated value range):

Private Sub Combox1_Change()

If Me.ComboBox1.Value <> "" Then
Dim sh As Worksheet
Set sh = ThisWorkbook.Sheets("Data Sheet")
Dim i As Integer

i = Application.Match(VBA.Clng(Me.Combox1.Value), sh.Range("L:L"), 0)

Thank you so much for any help, I appreciate it!
 

Excel Facts

Excel Wisdom
Using a mouse in Excel is the work equivalent of wearing a lanyard when you first get to college
Hi & welcome to MrExcel.
Try
VBA Code:
i = Application.Match(Me.Combox1.Value, sh.Range("L:L"), 0)
 
Upvote 0

Forum statistics

Threads
1,214,591
Messages
6,120,428
Members
448,961
Latest member
nzskater

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