+ Reply to Thread
Results 1 to 8 of 8

How to Convert this Code to Look for words instead of numbers

  1. #1
    Forum Contributor
    Join Date
    06-15-2013
    Location
    United States
    MS-Off Ver
    Excel 2016
    Posts
    213

    How to Convert this Code to Look for words instead of numbers

    Hello Everybody, I have the following code
    Please Login or Register  to view this content.
    from another macro i made. It takes a number in Sheet 1 and then checks in Sheet 2 columns C and D to see if it finds that number located at all. If it does then on Sheet 1 in Column F it will display the information found on sheet 2 in Column C. I'm trying to figure out how do I convert this formula to look for words instead on numbers but with the same kind of format. Pull it from sheet 1 and check in sheet 2. The same columns it will be checking except instead of just displaying the information from column C on Sheet 2 it will need to display Column B and C from Sheet 2 on Sheet 1 starting in Column F. Thanks for your help.

  2. #2
    Forum Expert Ron Coderre's Avatar
    Join Date
    03-22-2005
    Location
    Boston, Massachusetts
    MS-Off Ver
    2013, 2016, O365
    Posts
    6,996

    Re: How to Convert this Code to Look for words instead of numbers

    I *think* this regular formula will work for numbers OR words
    Formula: copy to clipboard
    Please Login or Register  to view this content.


    Note: That formula assumes that, if there is a match...there is only ONE.

    Is that something you can work with?
    Ron
    Former Microsoft MVP - Excel (2006 - 2015)
    Click here to see the Forum Rules

  3. #3
    Forum Contributor
    Join Date
    06-15-2013
    Location
    United States
    MS-Off Ver
    Excel 2016
    Posts
    213

    Re: How to Convert this Code to Look for words instead of numbers

    Formula Error.PNG Thanks for the response. I don't know if i did something wrong but this is the error message I get when I try to insert that formula. The reason why I'm trying to see if I need to convert something is because when i insert the original formula into the cell i get back #REF!.

  4. #4
    Forum Expert Ron Coderre's Avatar
    Join Date
    03-22-2005
    Location
    Boston, Massachusetts
    MS-Off Ver
    2013, 2016, O365
    Posts
    6,996

    Re: How to Convert this Code to Look for words instead of numbers

    My apologies...I didn't have a chance to test the formula.
    Try this variation:
    Formula: copy to clipboard
    Please Login or Register  to view this content.

    Is that something you can work with?

  5. #5
    Forum Contributor
    Join Date
    06-15-2013
    Location
    United States
    MS-Off Ver
    Excel 2016
    Posts
    213

    Re: How to Convert this Code to Look for words instead of numbers

    Hey Ron, Thanks for the help. That formula somewhat works but unfortunately the coding is puling the first row instead of the row that it finds the match in. So it found a match in row 9 in column c but it is displaying the value found in column C row 1 on sheet 2 when it should be displaying the row that the match is found and the information from Column C and D. is this possible?

  6. #6
    Forum Expert Ron Coderre's Avatar
    Join Date
    03-22-2005
    Location
    Boston, Massachusetts
    MS-Off Ver
    2013, 2016, O365
    Posts
    6,996

    Re: How to Convert this Code to Look for words instead of numbers

    I'm not seeing that behavior in my mock-up.
    Can you post a sample workbook that demonstrates the problem?

  7. #7
    Forum Contributor
    Join Date
    06-15-2013
    Location
    United States
    MS-Off Ver
    Excel 2016
    Posts
    213

    Re: How to Convert this Code to Look for words instead of numbers

    Hey Ron, It Seems to be working except the one thing I'm trying to do is have it pull the information from Columns A and B on sheet 2 when it finds a match. Right now i switched it so it pulls from Column B, Do you know how to add column A into the mix?test project.xlsm

  8. #8
    Forum Expert Ron Coderre's Avatar
    Join Date
    03-22-2005
    Location
    Boston, Massachusetts
    MS-Off Ver
    2013, 2016, O365
    Posts
    6,996

    Re: How to Convert this Code to Look for words instead of numbers

    Using your posted workbook...here are two approaches:
    1) A regular formula (not an array formula) that returns just Col_A matches
    Formula: copy to clipboard
    Please Login or Register  to view this content.

    2) A regular formula (not an array formula) that returns concatenated Col_A/Col_B matches
    Formula: copy to clipboard
    Please Login or Register  to view this content.

    One other thing...
    If you convert the lookup range to an Excel Table (see the attached file):
    1) you can reference the table fields directly
    2) the table will automatically expand and contract to accommodate the data
    3) you won't need to make Excel go through the work of calculating on 70,000 rows

    So the concatenated field formula would be:
    Formula: copy to clipboard
    Please Login or Register  to view this content.

    Yes, it's more verbose, but it's also very descriptive.

    Does that help?
    Attached Files Attached Files

+ 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. convert numbers to words?
    By prameeje in forum Excel General
    Replies: 2
    Last Post: 11-23-2012, 10:36 AM
  2. Convert words to numbers
    By SUNSHYN in forum Excel Formulas & Functions
    Replies: 9
    Last Post: 11-23-2012, 07:00 AM
  3. convert numbers to words
    By Bob Phillips in forum Excel Formulas & Functions
    Replies: 6
    Last Post: 09-06-2005, 12:05 PM
  4. [SOLVED] convert numbers to words
    By prags in forum Excel Formulas & Functions
    Replies: 0
    Last Post: 09-06-2005, 10:05 AM
  5. convert numbers to words
    By prags in forum Excel Formulas & Functions
    Replies: 0
    Last Post: 09-06-2005, 12:05 AM

Tags for this Thread

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