+ Reply to Thread
Results 1 to 8 of 8

error '13' type mismatch

  1. #1
    Registered User
    Join Date
    03-26-2008
    Posts
    24

    error '13' type mismatch

    I have had some help getting this code to here but now I am having troubles with the If statement. This code is building a list for a combo box. What I am trying to do is associate several items in the list to one other object. The code without the If statements does a 1:1 association just fine. What I am getting at the If is a Type Mismatch error. Any thoughts?


    Please Login or Register  to view this content.

  2. #2
    Forum Moderator Leith Ross's Avatar
    Join Date
    01-15-2005
    Location
    San Francisco, Ca
    MS-Off Ver
    2000, 2003, & 2010
    Posts
    23,258
    Hello Bope,

    Check that your Shape name matches what is in the code.
    Please Login or Register  to view this content.
    Sincerely,
    Leith Ross

  3. #3
    Registered User
    Join Date
    03-26-2008
    Posts
    24
    Leith,
    I am not quite following you here. If I record a macro and select the shape it records it as Shapes("#6").

  4. #4
    Forum Moderator Leith Ross's Avatar
    Join Date
    01-15-2005
    Location
    San Francisco, Ca
    MS-Off Ver
    2000, 2003, & 2010
    Posts
    23,258
    Hello Bope,

    Can you attach or send me the workbook? My email is [email protected].

    Thanks,
    Leith Ross

  5. #5
    Registered User
    Join Date
    03-26-2008
    Posts
    24
    Email sent.

    Thanks

  6. #6
    Forum Expert
    Join Date
    12-29-2004
    Location
    Michigan, USA
    MS-Off Ver
    2013
    Posts
    2,208
    Looks like a simple fix to me. Change:
    Please Login or Register  to view this content.
    to:
    Please Login or Register  to view this content.
    HTH

    Jason

  7. #7
    Forum Moderator Leith Ross's Avatar
    Join Date
    01-15-2005
    Location
    San Francisco, Ca
    MS-Off Ver
    2000, 2003, & 2010
    Posts
    23,258
    Hello Bope,

    Here is the revised macro code. The problem was with the Or operator in the If Then statement. This way is easier to read, maintain, and understand.
    Please Login or Register  to view this content.
    Sincerely,
    Leith Ross

  8. #8
    Registered User
    Join Date
    03-26-2008
    Posts
    24
    Jason, Thanks for the help with the syntax on the If statement. Leith sent me an email with his Case statements so that is what I saw first. Below is the final code with some additions since I have some groups in the list. This code shows the groups in the dropdown and associates a blank picture with them just in case someone acidentally chooses a header they wont get an error. This might not be the most elegant but it works. Thank you both for the help.

    Eric

    Please Login or Register  to view this content.

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

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