+ Reply to Thread
Results 1 to 4 of 4

VBA - Making corresponding descriptions to product ID's.

  1. #1
    Registered User
    Join Date
    05-30-2012
    Location
    Chicago, IL
    MS-Off Ver
    Excel 2003
    Posts
    3

    VBA - Making corresponding descriptions to product ID's.

    Greetings, this is my first post on Excel Forum and I am happy to be here! I would appreciate it if those reading this would please take the time to spread your Excel knowlege with a newcomer.

    .

    An example of an ordering code in cell A1 is - 4W/G12N9DA
    corresponding description in B1 - 4-Way, 12VDC Solenoid Operated, Concealed Manual Override, w/o Locating Hole, 1/2"NPT Terminal Box


    in this case, 4W = 4-way
    G12 = 12VDC Solenoid Operated
    N9 = Concealed Manual override
    absense of /62 = w/o locating hole
    DA = 1/2' NPT Terminal Box

    and so forth....


    Can somebody help me with a function or procedure in VBA where column A is searched for these codes and a resulting description is the output in the adjacent cell? Preferably conjoined separated by commas with Concatenate.

    I have basic VBA knowlege and a head start and writing such a program would save me countless hours due to the thousands of rows I am dealing with. Thank you!

  2. #2
    Valued Forum Contributor AlvaroSiza's Avatar
    Join Date
    09-19-2007
    Location
    Staffordshire
    MS-Off Ver
    2007
    Posts
    591

    Re: VBA - Making corresponding descriptions to product ID's.

    Few things:

    1. It would help your cause to post a sample workbook stripped of sensitive information.
    2. How many different codes are there and where do their descriptions reside in the workbook?
    3. Should every single occurance of a Column A code be checked for the absense of /62?
    4. Are the codes always ordered as you presented 2 digit code > 3 digit code > 2 digit code > 2 digit code, or will they be different?
    Last edited by AlvaroSiza; 05-30-2012 at 04:00 PM.
    Perhaps it was the Noid who should have avoided me...
    If you are satisfied with my solution click the small star icon on the left. Thanks
    1. Make a copy of your workbook and run the following code on your copy (just in case)
    2. With excel open, press ALT+F11 to open the Visual Basic Editor (VBE). From the "Insert" menu, select "Module".
    3. Paste the code from above into the empty white space. Close the VBE.
    4. From the developer tab, choose "Macros", select the Sub Name, and click "Run".

  3. #3
    Registered User
    Join Date
    05-30-2012
    Location
    Chicago, IL
    MS-Off Ver
    Excel 2003
    Posts
    3

    Re: VBA - Making corresponding descriptions to product ID's.

    1. I made a much more simple excel sheet for you to look at. It explains what is neccessary. excel program.xls
    2. I will make a separate sheet for the codes with the corresponding description
    3. Every occurance should be checked
    4. They will be different
    Last edited by redbull; 05-30-2012 at 04:39 PM.

  4. #4
    Registered User
    Join Date
    05-30-2012
    Location
    Chicago, IL
    MS-Off Ver
    Excel 2003
    Posts
    3

    Re: VBA - Making corresponding descriptions to product ID's.

    somebody please help

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

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