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 Can Read to You
Customize Quick Access Toolbar. From All Commands, add Speak Cells or Speak Cells on Enter to QAT. Select cells. Press Speak Cells.

Fluff

MrExcel MVP, Moderator
Joined
Jun 12, 2014
Messages
56,671
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,129,795
Messages
5,638,370
Members
417,023
Latest member
Zimbo38

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