+ Reply to Thread
Results 1 to 3 of 3

listbox runtime error 13 type mismatch

  1. #1
    Forum Contributor aprildu's Avatar
    Join Date
    04-13-2014
    Location
    Barrie,On, Canada
    MS-Off Ver
    Excel 2016
    Posts
    175

    listbox runtime error 13 type mismatch

    I have two listboxes with listbox1 controls listbox2. It works fine except when the name range has only one item, it gives a type mismatch error. Can someone point out the obvious? Many thanks!

    Please Login or Register  to view this content.

  2. #2
    Forum Expert
    Join Date
    04-23-2009
    Location
    Matrouh, Egypt
    MS-Off Ver
    Excel 2013
    Posts
    6,892

    Re: listbox runtime error 13 type mismatch

    Can you attach your sample workbook?
    < ----- Please click the little star * next to add reputation if my post helps you
    Visit Forum : From Here

  3. #3
    Forum Guru
    Join Date
    07-25-2011
    Location
    Florida
    MS-Off Ver
    Excel 2003
    Posts
    9,653

    Re: listbox runtime error 13 type mismatch

    If it's one item, the variant variable is not an array and the .List property won't accept a single value. Below converts a single value to an array if needed.

    Also; remove the () from Dim dataLbx2() As Variant

    Please Login or Register  to view this content.
    Surround your VBA code with CODE tags e.g.;
    [CODE]your VBA code here[/CODE]
    The # button in the forum editor will apply CODE tags around your selected text.

+ 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. Runtime Error 13 type mismatch
    By Gauravsinghp in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 08-18-2014, 06:23 AM
  2. Type mismatch runtime error 13
    By kalyanr12 in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 07-08-2014, 04:09 PM
  3. [SOLVED] runtime error 13 type mismatch
    By Justair07 in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 06-28-2013, 02:46 PM
  4. Runtime Error 13 Type Mismatch
    By vtsoldier2010 in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 03-30-2012, 12:59 PM
  5. Runtime error 13: Type mismatch
    By aman1234 in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 03-05-2012, 10:06 AM
  6. RunTime Error 13 and Type Mismatch...
    By TheNewGuy in forum Excel Programming / VBA / Macros
    Replies: 8
    Last Post: 08-24-2010, 09:24 AM
  7. Runtime Error 13 - type mismatch
    By hindlehey in forum Excel General
    Replies: 1
    Last Post: 11-07-2005, 10:55 AM

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