+ Reply to Thread
Results 1 to 8 of 8

Creating short forms for multiple codes

  1. #1
    Registered User
    Join Date
    05-25-2012
    Location
    toronto
    MS-Off Ver
    Excel 2010
    Posts
    31

    Creating short forms for multiple codes

    Hi,
    I have to combine multiple line items to make one representative single code but for the life of me have not been able to find a way to do it effectively. I have attached a sample file. Please do go through it and let me know if you know of a solution Thanks in advance.

    Input:
    Multiple Lot #, Code
    Lot1, ABC123
    Lot1, ABC124
    Lot1, ABC145
    Lot1, ABC147

    Output:
    Unique lot number, Single short code
    Lot1 - ABC123,4,45,7
    Attached Files Attached Files
    Last edited by vgr; 07-19-2014 at 01:33 AM.

  2. #2
    Administrator FDibbins's Avatar
    Join Date
    12-29-2011
    Location
    Duncansville, PA USA
    MS-Off Ver
    Excel 7/10/13/16/365 (PC ver 2310)
    Posts
    53,048

    Re: Creating short forms for multiple codes

    Try using a helper column - I used D, you can use what you want, and hide it if needed.

    In D2, copied down...
    =IF(A2=A1,D1&","&C2,C2)
    Then in J2, copied down...
    =OFFSET($A$1,MATCH(I2,$A$2:$A$21,0)-1+COUNTIF($A$2:$A$21,I2),3)
    1. Use code tags for VBA. [code] Your Code [/code] (or use the # button)
    2. If your question is resolved, mark it SOLVED using the thread tools
    3. Click on the star if you think someone helped you

    Regards
    Ford

  3. #3
    Registered User
    Join Date
    05-25-2012
    Location
    toronto
    MS-Off Ver
    Excel 2010
    Posts
    31

    Re: Creating short forms for multiple codes

    Thank you Ford,

    However, the major part of the problem is that I have to manually find out the characters to be used to make the final code. What I basically have is a Lot # and code... I need to pull out the single code from this information for multiple lots! Would be great if you could possibly figure something out on those lines. Thanks again.
    Last edited by vgr; 07-19-2014 at 01:02 AM.

  4. #4
    Forum Expert
    Join Date
    05-30-2012
    Location
    The Netherlands
    MS-Off Ver
    Office 365
    Posts
    14,987

    Re: Creating short forms for multiple codes

    First with the built in text to column.

    After that I run this code.

    See the attached file.

    Please Login or Register  to view this content.
    Notice my main language is not English.

    I appreciate it, if you reply on my solution.

    If you are satisfied with the solution, please mark the question solved.

    You can add reputation by clicking on the star * add reputation.

  5. #5
    Registered User
    Join Date
    05-25-2012
    Location
    toronto
    MS-Off Ver
    Excel 2010
    Posts
    31

    Re: Creating short forms for multiple codes

    Thank you for responding Oeldere. There is just one problem though, you took the output to be the input! The goal of this exercise was to reduce those 20 lines present in the sheet to 3. Only column A and B in sheet 1 are given. Column I & J is what one would expect in the output.
    Thank you again and I hope you are able to figure out a way to do this.

  6. #6
    Forum Expert
    Join Date
    05-30-2012
    Location
    The Netherlands
    MS-Off Ver
    Office 365
    Posts
    14,987

    Re: Creating short forms for multiple codes

    with formula and a filter.

    See the attached file.

  7. #7
    Forum Expert newdoverman's Avatar
    Join Date
    02-07-2013
    Location
    Port Dover, Ontario, Canada
    MS-Off Ver
    2010
    Posts
    10,330

    Re: Creating short forms for multiple codes

    Here is another solution for your consideration:

    I also used a helper column D and the same formula as FDibbins.

    The formula that I used in J2 is:

    Formula: copy to clipboard
    Please Login or Register  to view this content.
    Attached Files Attached Files
    Last edited by newdoverman; 07-19-2014 at 10:59 AM.
    <---------If you like someone's answer, click the star to the left of one of their posts to give them a reputation point for that answer.
    Ron W

  8. #8
    Administrator FDibbins's Avatar
    Join Date
    12-29-2011
    Location
    Duncansville, PA USA
    MS-Off Ver
    Excel 7/10/13/16/365 (PC ver 2310)
    Posts
    53,048

    Re: Creating short forms for multiple codes

    OK this is a bit messy and uses a bunch of helpers.

    In C2, copied down...
    =IF(E2<>E1,E2&F2&G2&H2&I2&J2&K2,IF(F2<>F1,F2&G2&H2&I2&J2&K2,IF(G2<>G1,G2&H2&I2&J2&K2,IF(H2<>H1,H2&I2&J2&K2,IF(I2<>I1,I2&J2&K2,IF(J2<>J1,J2&K2,IF(K2<>K1,K2,"")))))))

    Then move your summary to start in column O and copy this into E2:K2 and copy down
    =MID($B2,COLUMN(A$1),1)

    You can hide all of these columns

+ 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. Creating forms with multiple dropdown lists
    By AnnaDana in forum Excel General
    Replies: 3
    Last Post: 06-28-2013, 02:54 PM
  2. some codes to relate two user forms
    By bskaa in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 06-22-2013, 04:09 AM
  3. Creating a keyboard short cut for a excel spread sheet
    By moley165 in forum Excel General
    Replies: 2
    Last Post: 05-01-2012, 06:44 AM
  4. Help creating multiple user entry forms into a database
    By jacobkmc in forum Access Tables & Databases
    Replies: 2
    Last Post: 03-12-2012, 12:05 PM
  5. What codes can make Excel Macro to submit forms on web
    By FayettevilleEagles in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 02-16-2005, 09:40 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