Home |
Search |
Today's Posts |
|
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]() Make the Style property of the combobox fmDropDownList iso fmDropDownCombo. This prevents entering non-existing text. as is: during typing in the combo box the change event is fired.. with every character you type.. the vlookup is executed on partial text. if the vlookup cannot find the item it returns a variant of type Error which cannot be assigned to the Caption. Wrap the Vlookup in cStr() to prevent the runtime error. Small example: Sub foo() Dim v, s$ 'Put an error in the variant v = [=na()] 'Put it in a string w/o error s = CStr([=na()]) 'This will give err 13, Type Mismatch s = [=na()] End Sub -- keepITcool | www.XLsupport.com | keepITcool chello nl | amsterdam ssjody wrote : Rookie Here! This Code gives me a Type Mismatch Error if I try and Type any Value in my Combo Box but if I Pick a choice from the Drop Down it works fine. What am I doing wrong? Jody Private Sub cboCmPrimaryModel_Change() Dim wo As Range Set wo = Worksheets("PrimaryToOrionMakeCode").Range("A1:B3" ) If Me.cboCmPrimaryModel.Value "" Then Label4.Caption = Application.VLookup(cboCmPrimaryModel.Value, wo, 2, False) End If End Sub |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Visual Basic Error Run Time Error, Type Mismatch | Excel Discussion (Misc queries) | |||
Type Mismatch Error - Help Please | Excel Worksheet Functions | |||
Help: Compile error: type mismatch: array or user defined type expected | Excel Programming | |||
type mismatch error | Excel Programming | |||
Befuddled with For Next Loop ------ Run - Time Error '13' Type Mismatch Error | Excel Programming |