+ Reply to Thread
Results 1 to 10 of 10

Recognising part numbers from within a text string and lookup prices

  1. #1
    Forum Contributor
    Join Date
    09-28-2017
    Location
    UK
    MS-Off Ver
    2016
    Posts
    141

    Recognising part numbers from within a text string and lookup prices

    Hi everyone,

    I have a very simple worksheet (in terms of layout) which contains all its data within a single column. For example:

    (126476, Ghj67676767, 325452) blue table with 36 inch legs
    14 (438585685) green chair with 40 inch legs
    (ggfg556765, 456677) red box with brown lid
    123 table types are available

    The part numbers for each item (or set of items) are contained within the brackets. These are not always at the beginning of the data contained in each cell, but they are always in brackets and comma separated. As per the example, there are often two or three part numbers in a single cell (five is the maximum), followed by a description or other information. There are also other rows (such as the last line in the example above) which may contain or start with numbers but these are not in brackets so are not part numbers and should be ignored.

    My aim is to extract the part numbers into separate columns so I can then look up prices from a separate worksheet.

    Any help would be much appreciated.

    Andy
    Attached Files Attached Files

  2. #2
    Forum Guru
    Join Date
    08-15-2004
    Location
    Tokyo, Japan
    MS-Off Ver
    2013 O.365
    Posts
    22,524

    Re: Recognising part numbers from within a text string and lookup prices

    Not clear to me.

    If this is not what you want, need to see your expected result in a workbook.
    Please Login or Register  to view this content.

  3. #3
    Forum Contributor
    Join Date
    09-28-2017
    Location
    UK
    MS-Off Ver
    2016
    Posts
    141

    Re: Recognising part numbers from within a text string and lookup prices

    Thanks, that does work - but it only worked on rows 24 to 26 for some reason.

  4. #4
    Forum Guru
    Join Date
    08-15-2004
    Location
    Tokyo, Japan
    MS-Off Ver
    2013 O.365
    Posts
    22,524

    Re: Recognising part numbers from within a text string and lookup prices

    Like I said,
    Quote Originally Posted by jindon View Post
    Not clear to me.

    If this is not what you want, need to see your expected result in a workbook.

  5. #5
    Forum Contributor
    Join Date
    09-28-2017
    Location
    UK
    MS-Off Ver
    2016
    Posts
    141

    Re: Recognising part numbers from within a text string and lookup prices

    Please see the attached example - I have included a second worksheet showing the intended result.
    Attached Files Attached Files

  6. #6
    Forum Guru
    Join Date
    08-15-2004
    Location
    Tokyo, Japan
    MS-Off Ver
    2013 O.365
    Posts
    22,524

    Re: Recognising part numbers from within a text string and lookup prices

    Try this
    Please Login or Register  to view this content.
    Edited: code
    Last edited by jindon; 12-15-2018 at 07:47 AM.

  7. #7
    Forum Contributor
    Join Date
    09-28-2017
    Location
    UK
    MS-Off Ver
    2016
    Posts
    141

    Re: Recognising part numbers from within a text string and lookup prices

    This seems to work in some cases but not in others.

    Please see the attached example - I have highlighted the first few rows where the sub generated no results or partial results.
    Attached Files Attached Files

  8. #8
    Forum Guru
    Join Date
    03-02-2006
    Location
    Los Angeles, Ca
    MS-Off Ver
    WinXP/MSO2007;Win10/MSO2016
    Posts
    12,610

    Re: Recognising part numbers from within a text string and lookup prices

    maybe:
    Please Login or Register  to view this content.
    Ben Van Johnson

  9. #9
    Forum Guru
    Join Date
    08-15-2004
    Location
    Tokyo, Japan
    MS-Off Ver
    2013 O.365
    Posts
    22,524

    Re: Recognising part numbers from within a text string and lookup prices

    If you just want anything in between brackes and separate by a comma if there is then.
    Please Login or Register  to view this content.

  10. #10
    Forum Contributor
    Join Date
    09-28-2017
    Location
    UK
    MS-Off Ver
    2016
    Posts
    141

    Re: Recognising part numbers from within a text string and lookup prices

    +jindon, that works great! Many thanks for your help with this.

    +protonLeah, I get an error on the following line:

    PartCol = WorksheetFunction.Match(SrchStr, Range("1:1"), 0)

+ 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. [SOLVED] Populating prices based on part numbers in two different columns
    By aglawrence in forum Excel Programming / VBA / Macros
    Replies: 19
    Last Post: 11-07-2018, 08:15 AM
  2. [SOLVED] Multiple lookup to return value based on part of a text string
    By Cleric82 in forum Excel Formulas & Functions
    Replies: 4
    Last Post: 10-06-2017, 09:40 AM
  3. Lookup to reference part of a string of text.
    By Cleric82 in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 10-04-2017, 10:34 AM
  4. [SOLVED] Lookup formula to find part of a text string
    By A440 in forum Excel Formulas & Functions
    Replies: 4
    Last Post: 09-30-2015, 08:21 AM
  5. Lookup for Code that Corresponds to Part of string of text in a Cell
    By brandnew22 in forum Excel Formulas & Functions
    Replies: 12
    Last Post: 08-06-2013, 07:33 PM
  6. Replies: 3
    Last Post: 12-27-2012, 04:10 PM
  7. Extracting a number (part of a series of numbers) from a text string
    By dannyjoer in forum Excel Formulas & Functions
    Replies: 7
    Last Post: 11-09-2012, 10:17 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