+ Reply to Thread
Results 1 to 13 of 13

Thread: FIND the exact P/N in a multi P/N range of cells

  1. #1
    Registered User
    Join Date
    03-05-2011
    Location
    Barcelona, Spain
    MS-Off Ver
    Excel 2003
    Posts
    27

    FIND the exact P/N in a multi P/N range of cells

    Hi, all,

    The attached WB should clarifymy question.

    Thanks, Ben
    Attached Files Attached Files
    Last edited by Benjamin1; 08-20-2011 at 04:08 PM.

  2. #2
    Forum Guru mrice's Avatar
    Join Date
    06-22-2004
    Location
    Surrey, England
    MS-Off Ver
    Excel 2007/2010
    Posts
    3,004

    Re: FIND the exact P/N in a multi P/N range of cells

    Try this macro.

    Sub FindSpecial()
    Dim Cell As Range
    Dim SearchString As Range
    
    SearchString = Application.InputBox("Please enter search string")
    For Each Cell In Selection
    If Cell = SearchString Or Cell Like SearchString & ",*" Or Cell Like "*," & "SearchString" & ",*" Or Cell Like "*, " & "SearchString" & ",*" Then
        Cell.Select
        Exit Sub
    End If
    Next Cell
    End Sub
    Martin

    Eighty Twenty Spreadsheet Automation http://homepage.ntlworld.com/martin.rice1/ for all your Excel customisation and consulting needs.

    If my solution has saved you time and/or money, please consider donating to Cancer Research UK.

  3. #3
    Registered User
    Join Date
    03-05-2011
    Location
    Barcelona, Spain
    MS-Off Ver
    Excel 2003
    Posts
    27

    Re: FIND the exact P/N in a multi P/N range of cells

    mrice,

    Appreciate your prompt reply.

    As this was only a short example of a much larger table I prefer a WS formula and not VB code.

    BTH,

    a) I assume you ment: Dim SearchString As String

    b) The proposed macro does not end up with the requested sum.

    Maybe a User defined function could serve me right if it could be merged into an Array formula like the one in my attached WB.

    Thanks, Ben
    Last edited by Benjamin1; 08-20-2011 at 04:28 PM.

  4. #4
    Forum Guru shg's Avatar
    Join Date
    06-20-2007
    Location
    The Great State of Texas
    MS-Off Ver
    2003, 2007, 2010
    Posts
    25,772

    Re: FIND the exact P/N in a multi P/N range of cells

    It would be better to have only a single part number in each cell -- that's the way Excel is designed to work.
    Microsoft MVP - Excel
    Entia non sunt multiplicanda sine necessitate

  5. #5
    Registered User
    Join Date
    03-05-2011
    Location
    Barcelona, Spain
    MS-Off Ver
    Excel 2003
    Posts
    27

    Re: FIND the exact P/N in a multi P/N range of cells

    Thank you, shg,

    I know that but when the list was created it didn't bother anyone.

    Isn't there a way to accomplish my need with only a WS formula ?

    Ben

  6. #6
    Forum Guru shg's Avatar
    Join Date
    06-20-2007
    Location
    The Great State of Texas
    MS-Off Ver
    2003, 2007, 2010
    Posts
    25,772

    Re: FIND the exact P/N in a multi P/N range of cells

    I would never say it's not possible, but I'd change the worksheet rather than write an ugly slow formula.
    Microsoft MVP - Excel
    Entia non sunt multiplicanda sine necessitate

  7. #7
    Forum Guru martindwilson's Avatar
    Join Date
    06-23-2007
    Location
    London,England
    MS-Off Ver
    office 97 ,2007
    Posts
    10,788

    Re: FIND the exact P/N in a multi P/N range of cells

    here you go ,but i agree one cell per bit of data,
    when the list was created it didn't bother anyone.
    well it obviously is now lol
    err this is flawed it finds ca, and , aa when it shouldnt, hmm back to the drawing board
    Attached Files Attached Files
    Last edited by martindwilson; 08-20-2011 at 05:30 PM.
    "Unless otherwise stated all my comments are directed at OP"

    Mojito connoisseur and a dabbler in Cisco
    where does code go ?
    look here
    how to insert code

    how to enter array formula

    why use -- in sumproduct
    recommended reading
    wiki Mojito

    how to say no convincingly

    most important thing you need
    Martin Wilson: SPV
    and RSMBC

  8. #8
    Registered User
    Join Date
    03-05-2011
    Location
    Barcelona, Spain
    MS-Off Ver
    Excel 2003
    Posts
    27

    Re: FIND the exact P/N in a multi P/N range of cells

    Thank you, Martin,

    This is a big!!! progress.

    I inserted the 3 "M" column cells into the formula and change it a bit.

    Now I have one array result with T/F exactly what I was looking for (without any helper columns) except of the CA and AA misscounting.

    If you will find a solution for that - I'm all set.

    Thanks a lot and pls don't let it fall off the drawing board.

    Ben
    Last edited by Benjamin1; 08-20-2011 at 06:32 PM.

  9. #9
    Forum Guru martindwilson's Avatar
    Join Date
    06-23-2007
    Location
    London,England
    MS-Off Ver
    office 97 ,2007
    Posts
    10,788

    Re: FIND the exact P/N in a multi P/N range of cells

    Cant do anything at the mo my excel has gone mad!
    "Unless otherwise stated all my comments are directed at OP"

    Mojito connoisseur and a dabbler in Cisco
    where does code go ?
    look here
    how to insert code

    how to enter array formula

    why use -- in sumproduct
    recommended reading
    wiki Mojito

    how to say no convincingly

    most important thing you need
    Martin Wilson: SPV
    and RSMBC

  10. #10
    Registered User
    Join Date
    03-05-2011
    Location
    Barcelona, Spain
    MS-Off Ver
    Excel 2003
    Posts
    27

    Re: FIND the exact P/N in a multi P/N range of cells

    If I may quote Scarlett O'Hara:

    "...tomorrow is another day"

    Ben

  11. #11
    Forum Guru martindwilson's Avatar
    Join Date
    06-23-2007
    Location
    London,England
    MS-Off Ver
    office 97 ,2007
    Posts
    10,788

    Re: FIND the exact P/N in a multi P/N range of cells

    here is the best i can do,by putting the helpers on another sheet which can be hidden/very hidden
    Attached Files Attached Files
    "Unless otherwise stated all my comments are directed at OP"

    Mojito connoisseur and a dabbler in Cisco
    where does code go ?
    look here
    how to insert code

    how to enter array formula

    why use -- in sumproduct
    recommended reading
    wiki Mojito

    how to say no convincingly

    most important thing you need
    Martin Wilson: SPV
    and RSMBC

  12. #12
    Registered User
    Join Date
    03-05-2011
    Location
    Barcelona, Spain
    MS-Off Ver
    Excel 2003
    Posts
    27

    Re: FIND the exact P/N in a multi P/N range of cells

    Thanks.

    Will study this.

    Ben

  13. #13
    Forum Guru, retired Admin royUK's Avatar
    Join Date
    11-18-2003
    Location
    Derbyshire,UK
    MS-Off Ver
    Xp; 2007; 2010
    Posts
    25,637

    Re: FIND the exact P/N in a multi P/N range of cells

    Try clarifying the title, P/N could be anything
    Hope that helps.

    RoyUK
    --------
    If you are pleased with a member's answer then use the Star icon to rate it, if you are pleased enough to part with cash consider a donation to Children in Need

    For Excel Tips & Solutions, free examples and tutorials why not check out my downloads

    New members please read & follow the Forum Rules

    Remember to mark your questions Solved and rate the answer(s)

+ 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.2.0