+ Reply to Thread
Results 1 to 3 of 3

Data with values separated by dash, duplicate data and extract all values possible

  1. #1
    Valued Forum Contributor sans's Avatar
    Join Date
    10-19-2011
    Location
    London
    MS-Off Ver
    Excel 2010
    Posts
    550

    Data with values separated by dash, duplicate data and extract all values possible

    Hello,

    If anyone could offer help with the following it would a huge time-saver though I understand that it might be a difficult problem to solve.

    I have a "Data" section which contains all the values to be processed - what I would like to do is the following:

    extract all the first values, in a duplicated version of the original data
    extract all the second values, in another duplicated version of the original
    extract all the third values, in another duplicated version of the original
    extract all the first and second values, in another duplicated version of the original

    and so on, until all possible values are extracted.

    A few other points: All values in the data section are separated by a dash. The data are always numeric.

    In the attachment I am using formulas to achieve the results.

    If anyone knows how the above can be achieved with vba it would be greatly appreciated.

    Thank you
    Attached Files Attached Files

  2. #2
    Forum Expert
    Join Date
    01-15-2007
    Location
    Brisbane, Australia
    MS-Off Ver
    2007
    Posts
    6,591

    Re: Data with values separated by dash, duplicate data and extract all values possible

    Hi

    Here's some of it. You should be able to expand for any remaining combinations. If you have a variable number of items (3, or 6) etc, you may have to put in tests to see if they are going to be run.

    Please Login or Register  to view this content.
    rylo

  3. #3
    Valued Forum Contributor sans's Avatar
    Join Date
    10-19-2011
    Location
    London
    MS-Off Ver
    Excel 2010
    Posts
    550

    Re: Data with values separated by dash, duplicate data and extract all values possible

    Hi rylo,

    thank you very much for the superb macro. In one workbook, all the cells in a range have 5 variables i.e. 5 values separated by a dash. In another workbook the values might
    comprise of 6 variables. However I don't have any range that contains cells with mixed variables. So this won't be an issue. I edited the code to add all the combinations when in all the cells in a range contain 5 variables.

    Please Login or Register  to view this content.

    I get correct results so I don't think I made a mistake with the extra added code. Thank you very much for all the help once again and for the amazing macro! Really appreciated.
    Last edited by sans; 12-19-2012 at 06:44 PM.

+ 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