+ Reply to Thread
Results 1 to 8 of 8

VBA code for converting set of item coding to full names and percentage

  1. #1
    Registered User
    Join Date
    05-30-2012
    Location
    Amsterdam
    MS-Off Ver
    Excel 2010
    Posts
    5

    VBA code for converting set of item coding to full names and percentage

    Hello,

    Basicly i don't even know if this can be done...

    we use certain coding for fibers at my work:


    CO_100
    100% Cotton

    WO_100
    100% Wool

    PES_100
    100% Polyester

    CO/EL_95/5
    95% Cotton 5% Lycra

    WO/PAN_50/50
    50% wool 50% Acrylic

    WO/PA/CMD_50/30/20
    50% wool 30% nylon 20% modal

    CO/WO/PAN/PA_40/30/15/15
    40% cotton 30% wool 15% Acrylic 15% Nylon

    basicly the first entry needs to become the second entry
    It's a very big sheet and i have no idea how to do this in vba
    Last edited by Seisouhen; 06-01-2012 at 03:44 AM. Reason: Better Thread Title

  2. #2
    Valued Forum Contributor StevenM's Avatar
    Join Date
    03-23-2008
    Location
    New Lenox, IL USA
    MS-Off Ver
    2007
    Posts
    910

    Re: Need help with a sheet

    You will need to give a complete list of codes.
    CO=cotton
    WO=wool
    PAN=Acrylic
    PA=Nylon
    etc.

    Do you want the result to be a UDF (User defined function) or a macro?

  3. #3
    Registered User
    Join Date
    05-30-2012
    Location
    Amsterdam
    MS-Off Ver
    Excel 2010
    Posts
    5

    Re: Need help with a sheet

    ACETATE = AC
    ARAMID = AR
    ACRYLIC = PAN
    ALPACA = WP
    ANGORA = WA
    BAMBOO (Rayon) = CV
    CAMEL = WK
    CASHGORA = WC
    CASHMERE = WS
    COTTON = CO
    CUPRO = CUP
    ELASTODIENE = ED
    ELASTOMULTIESTER = EME
    GLASS = GF
    HEMP = CA
    JUTE = JU
    KAPOK = KP
    LAMA = WL
    LEATHER = LE
    LINEN = LI
    LYCRA = EL
    LYOCELL = CLY
    LUREX = MTF
    MODACRYLIC = MAC
    MODAL = CMD
    MOHAIR = WM
    NYLON = PA
    ORGANIC COTTON = OCO
    POLYAMIDE = PA
    POLYIMIDE = PI
    POLYESTER = PES
    POLYETHYLENE = PE
    POLYURETHANE = PU
    POLYPROPELENE = PP
    POLYISOPRENE = IR
    PVC = PVC
    RAMIE = RA
    RAYON = CV
    RECYCLED COTTON = RCO
    RECYCLED NYLON = RPA
    RECYCLED POLYESTER = RPES
    RUBBER (NATURAL) = NR
    SILK = SE
    SISAL = SI
    STRAW = ST
    SUEDE = SU
    TENCEL = CLY
    TRIACETATE = CTA
    VISCOSE = CV
    WOOL = WO
    YAK = WY
    VIRGIN WOOL = VW
    WOOD = WD
    RESIN = RES
    OTHER / UNSPECIFIED = OT

    a Macro would be great, Thank a lot for taking the time to help.

  4. #4
    Valued Forum Contributor StevenM's Avatar
    Join Date
    03-23-2008
    Location
    New Lenox, IL USA
    MS-Off Ver
    2007
    Posts
    910

    Re: Need help with a sheet

    Where does the macro find (for example): WO/PA/CMD_50/30/20
    And where would the macro write the new information?
    For example, is the former always in column A and the latter in column B? Where?

  5. #5
    Registered User
    Join Date
    05-30-2012
    Location
    Amsterdam
    MS-Off Ver
    Excel 2010
    Posts
    5

    Re: Need help with a sheet

    it's the information in column B and it should be written in column D

  6. #6
    Registered User
    Join Date
    05-30-2012
    Location
    Amsterdam
    MS-Off Ver
    Excel 2010
    Posts
    5

    Re: Need help with a sheet

    Hello again,

    Sorry for not being very clear.
    I prepared an example sheet

    On sheet 1 you see the basic layout how i get the data.
    in column A we have the productname and in columnn B the fibercoding.
    In column C i want to get the fully written fibername and perentage.

    Doing this with functions is a real pain and i have almost no knowledge of VBA.
    (ignore the last entry in sheet 2 in the I column picked a wrong example that will not be in the new format).
    On sheet 2 you will also find the correct fibercoding without duplicates.

    Thanks for you time and willingness the help.
    Attached Files Attached Files

  7. #7
    Valued Forum Contributor StevenM's Avatar
    Join Date
    03-23-2008
    Location
    New Lenox, IL USA
    MS-Off Ver
    2007
    Posts
    910

    Re: VBA code for converting set of item coding to full names and percentage

    I'm having computer problems, problems getting onto this site, and when I do get on, I'm unable to use the "Advanced" function to post a message. If you will send me an email, I will email back the code I have written. My email address can be found at: http://theicca.wikispaces.com/08+-+ICCA+Officers, StevenM.

  8. #8
    Registered User
    Join Date
    05-30-2012
    Location
    Amsterdam
    MS-Off Ver
    Excel 2010
    Posts
    5

    Re: VBA code for converting set of item coding to full names and percentage

    Thank you so much Steven your code works great

+ 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.6.0 RC 1