+ Reply to Thread
Results 1 to 8 of 8

Excel VBA Run-time error '13' Type mismatch

  1. #1
    Registered User
    Join Date
    11-27-2013
    Location
    Mumbai
    MS-Off Ver
    Excel 2007
    Posts
    35

    Excel VBA Run-time error '13' Type mismatch

    i have a excl workbook with sheet1 & mastersheet

    in Master sheet i have defined values in list Column D & F
    Column D has COUNTRY as heading and country Names below it
    Column F has CITY and city list

    Im column A i have 2 data list
    as

    COUNTRY
    CITY

    i have dropdown in excel sheet (SHEET1) in Column K populated with data from MASTER in Column A ie city & country

    When i select city i need Dropdown in column L to be populated with Citylist from MASTERS COLUMN F and if city seleced i need to get data from column D
    but i get type mismatch error
    Please Login or Register  to view this content.
    Last edited by svibuk; 04-30-2014 at 05:43 AM.

  2. #2
    Forum Guru Kaper's Avatar
    Join Date
    12-14-2013
    Location
    Warsaw, Poland
    MS-Off Ver
    most often: Office 365 in Windows environment
    Posts
    8,613

    Re: Excel VBA Run-time error '13' Type mismatch

    and what is Range("CST") ?
    and which line highlights while debugging?
    Best Regards,

    Kaper

  3. #3
    Registered User
    Join Date
    11-27-2013
    Location
    Mumbai
    MS-Off Ver
    Excel 2007
    Posts
    35

    Re: Excel VBA Run-time error '13' Type mismatch

    sry its country
    PartNoRow = Application.Match(.Value, wsLists.Range("COUNTRY"), 0) i get error after this
    i think its not giving a integer value for PartNoRow
    if i hardcode PartNoRow =1
    i dont get the mismatch error

    2) how do i bind data to dropdown i have created this dropdown from my application code not from vba

    i have
    For Each cPart In wsLists.Range("CITY")
    .Offset(0, 1).Value = cPart.Value
    MsgBox (cPart.Value)
    Next cPart

    i get the different value but not able to fill the dropdown in thet cell

  4. #4
    Forum Guru Norie's Avatar
    Join Date
    02-02-2005
    Location
    Stirling, Scotland
    MS-Off Ver
    Microsoft Office 365
    Posts
    19,643

    Re: Excel VBA Run-time error '13' Type mismatch

    It sounds like Application.Match hasn't found a match and is returning an error.

    If that's the case and you've declared PartNoRow as an (Long?) Integer then you'll get a Type Mismatch.

    To prevent the error declare as Variant instead of Integer.

    If there's definitely a match then you'll need to find out why Application
    Match is returning an error.
    If posting code please use code tags, see here.

  5. #5
    Forum Guru Kaper's Avatar
    Join Date
    12-14-2013
    Location
    Warsaw, Poland
    MS-Off Ver
    most often: Office 365 in Windows environment
    Posts
    8,613

    Re: Excel VBA Run-time error '13' Type mismatch

    1) use code tags - see forum rules why (you know how-to). edit your post.
    2)
    Please Login or Register  to view this content.
    so in next code line you de facto do
    Please Login or Register  to view this content.
    is it right?

  6. #6
    Registered User
    Join Date
    11-27-2013
    Location
    Mumbai
    MS-Off Ver
    Excel 2007
    Posts
    35

    Re: Excel VBA Run-time error '13' Type mismatch

    Please Login or Register  to view this content.
    yes in .value i get COUNTRY or CITY whichever is selected
    even if i use it directly i get error

  7. #7
    Forum Guru Norie's Avatar
    Join Date
    02-02-2005
    Location
    Stirling, Scotland
    MS-Off Ver
    Microsoft Office 365
    Posts
    19,643
    What is this supposed to reference?

    Please Login or Register  to view this content.

  8. #8
    Registered User
    Join Date
    11-27-2013
    Location
    Mumbai
    MS-Off Ver
    Excel 2007
    Posts
    35

    Re: Excel VBA Run-time error '13' Type mismatch

    Country is a defined name for a range of cells which contains country names

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. Excel VBA Run-time error '13' Type mismatch
    By pankajpm in forum Excel Programming / VBA / Macros
    Replies: 12
    Last Post: 12-27-2013, 05:34 AM
  2. [SOLVED] Excel VBA Run-time error '13' Type mismatch
    By mackypogi in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 09-17-2013, 02:15 AM
  3. Excel VBA Run-time error '13' Type mismatch
    By edgaryp in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 08-01-2013, 06:48 PM
  4. run-time error 13: type mismatch in VBA (Excel 2007)
    By zeno1 in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 04-20-2012, 04:38 PM
  5. run time error(13) type mismatch in Excel Feed
    By lorneg in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 05-22-2006, 05:40 PM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1