Type mismatch Run-time Error 13

auber

New Member
Joined
Nov 18, 2009
Messages
5
Hi people,

I have big, big problem and i need to fix it very fast.

Every time i run user form and select value in combobox 4 i get run time error 13 type mismatch at part of code witch i will mark in code i post.

Code:
Private Sub ComboBox4_Change()
[B][COLOR=red][SIZE=3][COLOR=yellow]TextBox12.Text = Application.VLookup(ComboBox4.Value, Sheets("BazaEvidencija").Range("ax6:bd13"), 7, False)[/COLOR][/SIZE][/COLOR][/B]
End Sub
Private Sub UserForm_Initialize()
With Worksheets("BazaEvidencija")
Set Rng = .Range(.Range("ax6"), .Range("ax6").End(xlDown))
End With
Set Rng = Rng
ComboBox4.RowSource = Rng.Address(external:=True)
With Worksheets("BazaEvidencija")
Set Rng = .Range(.Range("au6"), .Range("au6").End(xlDown))
End With
Set Rng = Rng
ComboBox3.RowSource = Rng.Address(external:=True)
End Sub
 
Private Sub CommandButton1_Click()
Dim red As Long
Dim ws As Worksheet
Set ws = Worksheets("BazaEvidencija")
red = ws.Cells(Rows.Count, 15).End(xlUp).Offset(1, 0).Row
ws.Cells(red, 10).Value = TextBox11.Value
ws.Cells(red, 15).Value = ComboBox4.Value
 
ws.Cells(red, 16).Value = TextBox1.Value
ws.Cells(red, 17).Value = TextBox2.Value
ws.Cells(red, 19).Value = ComboBox3.Value
ws.Cells(red, 20).Value = TextBox3.Value
ws.Cells(red, 22).Value = TextBox4.Value
ws.Cells(red, 24).Value = TextBox5.Value
ws.Cells(red, 26).Value = TextBox6.Value
ws.Cells(red, 28).Value = TextBox7.Value
ws.Cells(red, 30).Value = TextBox8.Value
ws.Cells(red, 32).Value = TextBox9.Value
ws.Cells(red, 34).Value = TextBox10.Value
ComboBox4.Value = ""
ComboBox3.Value = ""
TextBox1.Value = ""
TextBox2.Value = ""
TextBox3.Value = ""
TextBox4.Value = ""
TextBox5.Value = ""
TextBox6.Value = ""
TextBox7.Value = ""
TextBox8.Value = ""
TextBox9.Value = ""
TextBox10.Value = ""
TextBox11.Value = ""
End Sub
Private Sub CommandButton2_Click()
End
End Sub

could somebody help me please
 

Excel Facts

What is the fastest way to copy a formula?
If A2:A50000 contain data. Enter a formula in B2. Select B2. Double-click the Fill Handle and Excel will shoot the formula down to B50000.
That suggests that VLOOKUP() is returning an error (ie. it can't find the lookup value in the lookup column).

You can confirm that is the case by:
Code:
Private Sub ComboBox4_Change()
    TextBox12.Text = CStr(Application.VLookup(ComboBox4.Value, Sheets("BazaEvidencija").Range("ax6:bd13"), 7, False))
End Sub
Does an Error 2042 (#N/A) get returned to the textbox...?
 
Upvote 0
Your shoot was good, but it isnt solve problem.
Yes, every time.
I think that something is not good with vlookup values, but i dont know what.
 
Upvote 0
So now we know the problem.
I think that something is not good with vlookup values, but i dont know what.
What values are being loaded into the combobox, and what are the values in the lookup table? A screenshot of the lookup table would be useful.
 
Upvote 0

Forum statistics

Threads
1,215,365
Messages
6,124,513
Members
449,168
Latest member
CheerfulWalker

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