+ Reply to Thread
Results 1 to 4 of 4

Error 13 when searching for string matching range values

  1. #1
    Valued Forum Contributor
    Join Date
    01-16-2012
    Location
    England
    MS-Off Ver
    MS 365 Version 2501 64-bit
    Posts
    1,465

    Error 13 when searching for string matching range values

    Col A of Sheet 2 has a series of "keywords"

    Col B on sheet 1 has a list of products.

    Macro should "cycle" through each product to find matches with any keyword.

    If a match is found. the keyword should be added to Col C of the row

    If no match is found, Col C of the row becomes "Other"

    Code is throwing an Error 13 "Type Mismatch"

    Please Login or Register  to view this content.
    Suggestions and pointers welcome as ever

    Ochimus
    Attached Files Attached Files
    Last edited by Ochimus; 03-07-2016 at 10:45 AM.

  2. #2
    Forum Expert Keebellah's Avatar
    Join Date
    01-12-2014
    Location
    The Netherlands
    MS-Off Ver
    Office 2021 (Windows)
    Posts
    7,937

    Re: Error 13 when searching for string matching range values

    Hi Ochimus,
    It's just a question of closely looking at what you're doing and avoiding syntax errors

    The red code is a syntax error, you forgot the first parameter with Instr

    The green is new code. This is to check if something was found. If it is false after the second loop then Other,

    In your method Other will always be set


    Please Login or Register  to view this content.
    Hope this helps
    ---
    Hans
    "IT" Always crosses your path!
    May the (vba) code be with you... if it isn't; start debugging!
    If you like my answer, Click the * below to say thank-you

  3. #3
    Valued Forum Contributor
    Join Date
    01-16-2012
    Location
    England
    MS-Off Ver
    MS 365 Version 2501 64-bit
    Posts
    1,465

    Re: Error 13 when searching for string matching range values

    Keebellah,

    Many thanks for the quick corrections. Now works perfectly.

    Not sure how I didn't see that my code would "overwrite" the keywords at the end!

    Ochimus

  4. #4
    Forum Expert Keebellah's Avatar
    Join Date
    01-12-2014
    Location
    The Netherlands
    MS-Off Ver
    Office 2021 (Windows)
    Posts
    7,937

    Re: Error 13 when searching for string matching range values

    It happens, you're so focused on one thing that the other one is forgotten.
    Glad to have helped

+ 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. Having trouble searching for and matching 2 values
    By PaulMcCudden in forum For Other Platforms(Mac, Google Docs, Mobile OS etc)
    Replies: 0
    Last Post: 06-25-2015, 05:54 PM
  2. [SOLVED] Searching for unknown text string in a range and then matching it to a reference table
    By the_nibs in forum Excel Formulas & Functions
    Replies: 13
    Last Post: 06-10-2015, 07:26 AM
  3. Searching for user defined value in range, sending only these values to array ERROR
    By sgonzalez90 in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 02-01-2013, 01:02 AM
  4. Searching for multiple matching column values
    By watppuiu in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 06-05-2012, 12:19 AM
  5. Searching for values within a string across a range of cells
    By futureboy in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 11-22-2010, 07:53 PM
  6. Searching a String for a Matching Word from another String
    By ExcelTip in forum Tips and Tutorials
    Replies: 0
    Last Post: 08-23-2005, 04:01 AM
  7. [SOLVED] Formula for Searching & matching two values in excel
    By Chris in forum Excel General
    Replies: 1
    Last Post: 01-07-2005, 01:06 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