+ Reply to Thread
Results 1 to 10 of 10

Macro to create new groups

  1. #1
    Registered User
    Join Date
    07-26-2004
    Posts
    6

    Macro to create new groups

    I need to improve a medium size data base in which the same article could have many differently written names by grouping these articles in new groups and would like to use VBA macro for this excersice. I have roughly 50 different article names which need to be grouped into 10 new names. I tried to solve it by using vlookup-functions and it works, but the file size explodes....

    I have attached a small sample data base including the article names and the new group names.
    Attached Files Attached Files
    Last edited by Gustav; 11-24-2010 at 08:49 AM. Reason: Edited attachment - added before and after

  2. #2
    Forum Expert JBeaucaire's Avatar
    Join Date
    03-21-2004
    Location
    Bakersfield, CA
    MS-Off Ver
    2010, 2016, Office 365
    Posts
    33,492

    Re: Macro to create new groups

    Add your desired results in an AFTER page on that sample workbook.
    _________________
    Microsoft MVP 2010 - Excel
    Visit: Jerry Beaucaire's Excel Files & Macros

    If you've been given good help, use the icon below to give reputation feedback, it is appreciated.
    Always put your code between code tags. [CODE] your code here [/CODE]

    ?None of us is as good as all of us? - Ray Kroc
    ?Actually, I *am* a rocket scientist.? - JB (little ones count!)

  3. #3
    Registered User
    Join Date
    07-26-2004
    Posts
    6

    Re: Macro to create new groups

    I have edited the attachment in the sample workbook. Thank you!

  4. #4
    Forum Expert snb's Avatar
    Join Date
    05-09-2010
    Location
    VBA
    MS-Off Ver
    Redhat
    Posts
    5,649

    Re: Macro to create new groups

    Please Login or Register  to view this content.



  5. #5
    Registered User
    Join Date
    07-26-2004
    Posts
    6

    Re: Macro to create new groups

    Thank you snb, your code worked excellent for my sample set.

    My problem is that there are some blank (empty) cells in my full data set (I should have included blank cells in my sample, sorry). I have attached a new sample.
    Attached Files Attached Files

  6. #6
    Forum Expert snb's Avatar
    Join Date
    05-09-2010
    Location
    VBA
    MS-Off Ver
    Redhat
    Posts
    5,649

    Re: Macro to create new groups

    Please Login or Register  to view this content.

  7. #7
    Registered User
    Join Date
    07-26-2004
    Posts
    6

    Re: Macro to create new groups

    Thank you snb, it works perfectly. I just have a last question..... If the "article" column would be #20 (insted of #1) and the new column would be #36 (insted of #7 (6)), how do I need to change the code? Thank you for your brillant help!

    Best regards
    Gustav

  8. #8
    Forum Expert snb's Avatar
    Join Date
    05-09-2010
    Location
    VBA
    MS-Off Ver
    Redhat
    Posts
    5,649

    Re: Macro to create new groups

    Please Login or Register  to view this content.

  9. #9
    Registered User
    Join Date
    07-26-2004
    Posts
    6

    Re: Macro to create new groups

    Thank you snb, your help was great!

  10. #10
    Registered User
    Join Date
    07-26-2004
    Posts
    6

    Re: Macro to create new groups

    New file attached
    Attached Files Attached Files

+ 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