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

What did Pito Salas invent?
Pito Salas, working for Lotus, popularized what would become to be pivot tables. It was released as Lotus Improv in 1989.

Fluff

MrExcel MVP, Moderator
Joined
Jun 12, 2014
Messages
56,883
Office Version
  1. 365
Platform
  1. Windows
Hi & welcome to MrExcel.
Try
VBA Code:
i = Application.Match(Me.Combox1.Value, sh.Range("L:L"), 0)
 

Watch MrExcel Video

Forum statistics

Threads
1,130,172
Messages
5,640,580
Members
417,151
Latest member
ChickenTenderer

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
Top