+ Reply to Thread
Results 1 to 44 of 44

Vb code To Find the missing triplets and complete the number series..?

  1. #1
    Forum Contributor
    Join Date
    01-21-2011
    Location
    London,UK
    MS-Off Ver
    Excel 2007
    Posts
    241

    Vb code To Find the missing triplets and complete the number series..?

    Good evening,
    I’m not sure if it possible, if you could provide me with a vb code please, to do this;
    I have a list”703 rows” of string numbers” triplet” in column “C”, I need the code to fill columns”D:O”from the list in column”A” to complete the the missing numbers from column “C” so
    That each row contain each of the 39 numbers once,and each row of 8436 of column “A” to be use only once too.
    I have done example for first row, in the attached file;
    Thanks for your patienceand appreciate any help on this.
    Sem
    Attached Files Attached Files

  2. #2
    Forum Contributor arlu1201's Avatar
    Join Date
    09-09-2011
    Location
    Bangalore, India
    MS-Off Ver
    Excel 2003 & 2007
    Posts
    19,166

    Re: Vb code To Find the missing triplets and complete the number series..?

    Should all the 8436 rows be used? Or just those that are required to complete the numbers?

    If i need 1 particular number to complete the 39 number sequence but its already used in another row, what should i do?
    If I have helped, Don't forget to add to my reputation (click on the star below the post)
    Don't forget to mark threads as "Solved" (Thread Tools->Mark thread as Solved)
    Use code tags when posting your VBA code: [code] Your code here [/code]

  3. #3
    Forum Contributor
    Join Date
    01-21-2011
    Location
    London,UK
    MS-Off Ver
    Excel 2007
    Posts
    241

    Re: Vb code To Find the missing triplets and complete the number series..?

    Hi Arlu,
    thank you for your time,very much appreciated.
    Yes all 8436 rows must be used to complete columns "D to O".
    column"C" have 703rows x 12 columns"D:O" it will give you a total of 8436 .
    If i need 1 particular number to complete the 39 number sequence but its already used in another row, what should i do?
    That is why it's very difficult to solve and maybe there are misplaced rows,in short the code have to loop through the 8436 rows to find the missing string to complete the series.
    Thanks again and Kind regards.
    Sem

  4. #4
    Forum Contributor
    Join Date
    01-21-2011
    Location
    London,UK
    MS-Off Ver
    Excel 2007
    Posts
    241

    Re: Vb code To Find the missing triplets and complete the number series..?

    Any suggestion please,?
    Thank you.
    Sem

  5. #5
    Forum Contributor
    Join Date
    01-21-2011
    Location
    London,UK
    MS-Off Ver
    Excel 2007
    Posts
    241

    Re: Vb code To Find the missing triplets and complete the number series..?

    Bump........?

  6. #6
    Forum Contributor arlu1201's Avatar
    Join Date
    09-09-2011
    Location
    Bangalore, India
    MS-Off Ver
    Excel 2003 & 2007
    Posts
    19,166

    Re: Vb code To Find the missing triplets and complete the number series..?

    Will work something out for you shortly.

  7. #7
    Forum Contributor
    Join Date
    01-21-2011
    Location
    London,UK
    MS-Off Ver
    Excel 2007
    Posts
    241

    Re: Vb code To Find the missing triplets and complete the number series..?

    Thank you Arlu,
    Very very much appreciated.

  8. #8
    Forum Contributor
    Join Date
    01-21-2011
    Location
    London,UK
    MS-Off Ver
    Excel 2007
    Posts
    241

    Re: Vb code To Find the missing triplets and complete the number series..?

    Is this Solveable?
    Thanks for any assistance......
    Sem

  9. #9
    Forum Contributor arlu1201's Avatar
    Join Date
    09-09-2011
    Location
    Bangalore, India
    MS-Off Ver
    Excel 2003 & 2007
    Posts
    19,166

    Re: Vb code To Find the missing triplets and complete the number series..?

    Its a lil complicated. Need to work it out a lil. Give me sometime.

  10. #10
    Forum Contributor
    Join Date
    01-21-2011
    Location
    London,UK
    MS-Off Ver
    Excel 2007
    Posts
    241

    Re: Vb code To Find the missing triplets and complete the number series..?

    Hi Arlu,
    Thanks very much for your time and no harry you can have as much time as you can no problem at all,
    even if it takes months.
    Thanks again and much obliged.
    sem

  11. #11
    Forum Guru
    Join Date
    08-15-2004
    Location
    Tokyo, Japan
    MS-Off Ver
    2013 O.365
    Posts
    22,525

    Re: Vb code To Find the missing triplets and complete the number series..?

    Again, will not accept further alteration.
    Use it at your own risk.
    Please Login or Register  to view this content.

  12. #12
    Forum Contributor
    Join Date
    01-21-2011
    Location
    London,UK
    MS-Off Ver
    Excel 2007
    Posts
    241

    Re: Vb code To Find the missing triplets and complete the number series..?

    Hi Jindon,
    Thanks ever so much for your help but unfortunately the code keep repeating the same triplets
    which not what what i need.
    That each row contain each of the 39 numbers once,and each row of 8436 of column “A” to be use only once too.
    See attachment for code result
    Thanks again and very sorry for all this.
    sem
    Attached Files Attached Files

  13. #13
    Forum Contributor
    Join Date
    01-21-2011
    Location
    London,UK
    MS-Off Ver
    Excel 2007
    Posts
    241

    Re: Vb code To Find the missing triplets and complete the number series..?

    Hi,
    I used Vb code provided by wonderful and genious” Marcol” it looks promising;
    But I need your help to change and add some sort of looping or Do until that keeps going until all matches have been made?
    And also to remove that “char” bits and instead of one number in each cell I need each triplet in cells if possible,like in my first post attachment.Because every time you run the code it gives the same result eventhough not correct one.

    Please Login or Register  to view this content.
    Here is the result in the attachment
    Thanks again for any help or suggestions.
    Sem
    .
    Attached Files Attached Files

  14. #14
    Forum Expert nilem's Avatar
    Join Date
    10-22-2011
    Location
    Ufa, Russia
    MS-Off Ver
    2013
    Posts
    3,377

    Re: Vb code To Find the missing triplets and complete the number series..?

    maybe so (run-time macro around 9.5 seconds)
    Please Login or Register  to view this content.
    Attached Files Attached Files

  15. #15
    Forum Contributor
    Join Date
    01-21-2011
    Location
    London,UK
    MS-Off Ver
    Excel 2007
    Posts
    241

    Re: Vb code To Find the missing triplets and complete the number series..?

    Hi Nilem,
    Thanks ever so much for your invaluable help, very very much appreciated.
    It's almost there..would you kindly add some sort of looping or Do until it get all the results?
    and also when i run with my worksheet i got compile error;(User-Defined type not defined)and it highlite
    this line
    With New Dictionary
    thanks again and very much obliged.
    Sem

  16. #16
    Forum Expert nilem's Avatar
    Join Date
    10-22-2011
    Location
    Ufa, Russia
    MS-Off Ver
    2013
    Posts
    3,377

    Re: Vb code To Find the missing triplets and complete the number series..?

    replace this line
    Please Login or Register  to view this content.
    with this line
    Please Login or Register  to view this content.
    or would be better if you plug in a reference: TOOLS menu - References - Microsoft Scripting Runtime - Ok.

  17. #17
    Forum Contributor
    Join Date
    01-21-2011
    Location
    London,UK
    MS-Off Ver
    Excel 2007
    Posts
    241

    Re: Vb code To Find the missing triplets and complete the number series..?

    Hi Nilem,
    thank you very much for your time and effort much appreciate.
    would you kindly insert a loop so the code keep going until it find all the result like in my attached workbook?
    That would be fantastic if you can do it?Think of it as a password .?
    Thanks again and very kind regards
    Sem
    Attached Files Attached Files

  18. #18
    Forum Contributor
    Join Date
    01-21-2011
    Location
    London,UK
    MS-Off Ver
    Excel 2007
    Posts
    241

    Re: Vb code To Find the missing triplets and complete the number series..?

    Good evening <
    anyone can assist me how to add loop to "Nilem's" code please???
    Thanks
    sem

  19. #19
    Forum Contributor
    Join Date
    01-21-2011
    Location
    London,UK
    MS-Off Ver
    Excel 2007
    Posts
    241

    Re: Vb code To Find the missing triplets and complete the number series..?

    I would very much appreciate, for any suggestion ..
    Thank you.
    sem

  20. #20
    Forum Contributor
    Join Date
    01-21-2011
    Location
    London,UK
    MS-Off Ver
    Excel 2007
    Posts
    241

    Re: Vb code To Find the missing triplets and complete the number series..?

    Any ideas please?
    Thanks
    sem

  21. #21
    Forum Contributor
    Join Date
    01-21-2011
    Location
    London,UK
    MS-Off Ver
    Excel 2007
    Posts
    241

    Re: Vb code To Find the missing triplets and complete the number series..?

    Very sorry for bumping....?

  22. #22
    Forum Contributor
    Join Date
    01-21-2011
    Location
    London,UK
    MS-Off Ver
    Excel 2007
    Posts
    241

    Re: Vb code To Find the missing triplets and complete the number series..?

    Bump??????

  23. #23
    Forum Contributor
    Join Date
    01-21-2011
    Location
    London,UK
    MS-Off Ver
    Excel 2007
    Posts
    241

    Question Re: Vb code To Find the missing triplets and complete the number series..?

    Help Please...?

  24. #24
    Forum Contributor
    Join Date
    01-21-2011
    Location
    London,UK
    MS-Off Ver
    Excel 2007
    Posts
    241

    Re: Vb code To Find the missing triplets and complete the number series..?

    Bump..........

  25. #25
    Forum Contributor
    Join Date
    01-21-2011
    Location
    London,UK
    MS-Off Ver
    Excel 2007
    Posts
    241

    Re: Vb code To Find the missing triplets and complete the number series..?

    good evening,
    i would appreciate if someone can assist to insert loop to the code in post #14
    to keep trying untill it find all the correct result.
    thanks and kind regards.
    sem

  26. #26
    Forum Contributor
    Join Date
    01-21-2011
    Location
    London,UK
    MS-Off Ver
    Excel 2007
    Posts
    241

    Re: Vb code To Find the missing triplets and complete the number series..?

    Bump.......

  27. #27
    Forum Contributor
    Join Date
    01-21-2011
    Location
    London,UK
    MS-Off Ver
    Excel 2007
    Posts
    241

    Re: Vb code To Find the missing triplets and complete the number series..?

    Bump............

  28. #28
    Forum Contributor
    Join Date
    01-21-2011
    Location
    London,UK
    MS-Off Ver
    Excel 2007
    Posts
    241

    Re: Vb code To Find the missing triplets and complete the number series..?

    Very sorry for bumping....?

  29. #29
    Forum Contributor arlu1201's Avatar
    Join Date
    09-09-2011
    Location
    Bangalore, India
    MS-Off Ver
    Excel 2003 & 2007
    Posts
    19,166

    Re: Vb code To Find the missing triplets and complete the number series..?

    Oops....i can see all the bumps....will try something out for you. Can you explain what loop you need?

  30. #30
    Forum Contributor
    Join Date
    01-21-2011
    Location
    London,UK
    MS-Off Ver
    Excel 2007
    Posts
    241

    Re: Vb code To Find the missing triplets and complete the number series..?

    Good evening Arlu,
    thank you very very much for your time and very sorry for keep bumping...Its realy emberassing.
    What i need is a loop to be incerted to Nilem's code in post#14. because when ever you run the code its give the same result even though its not the complete result.so if anyone can assist to keep the code looping until it find all "703rows by 13 colums" complete and correct result without duplication.
    Thank you again,
    Kind regards
    sem

  31. #31
    Forum Contributor
    Join Date
    01-21-2011
    Location
    London,UK
    MS-Off Ver
    Excel 2007
    Posts
    241

    Re: Vb code To Find the missing triplets and complete the number series..?

    Hi ,
    When i run the code in post #14 to list as in my first post it gives me only 69 result out of 703 rows.but when i randomly sort those list in column “A and C” i get higher numbers of the results “367 out of 703” the highest.so is there any way to make this process done by the code to keep randomise those lists in columns “A and C” until all 703 rows completed or to set a parameter say 500 or 50000 times and after that to give me the highest result from that process.
    Thanks
    Sem

  32. #32
    Forum Contributor
    Join Date
    01-21-2011
    Location
    London,UK
    MS-Off Ver
    Excel 2007
    Posts
    241

    Re: Vb code To Find the missing triplets and complete the number series..?

    Bump,,,,,,,,

  33. #33
    Forum Contributor
    Join Date
    01-21-2011
    Location
    London,UK
    MS-Off Ver
    Excel 2007
    Posts
    241

    Re: Vb code To Find the missing triplets and complete the number series..?

    Would someone kindly assist me to solve this please?
    Thanks
    sem

  34. #34
    Forum Contributor
    Join Date
    01-21-2011
    Location
    London,UK
    MS-Off Ver
    Excel 2007
    Posts
    241

    Re: Vb code To Find the missing triplets and complete the number series..?

    bump,,,,,,,,,

  35. #35
    Forum Expert nilem's Avatar
    Join Date
    10-22-2011
    Location
    Ufa, Russia
    MS-Off Ver
    2013
    Posts
    3,377

    Re: Vb code To Find the missing triplets and complete the number series..?

    Hi, Sem. Are you sure that your problem has a solution?
    I tried to simulate your example with 01, 02, ...09 triples - all the conditions of your problem can not be performed even by hand.
    Perhaps I'm wrong.

  36. #36
    Forum Contributor
    Join Date
    01-21-2011
    Location
    London,UK
    MS-Off Ver
    Excel 2007
    Posts
    241

    Re: Vb code To Find the missing triplets and complete the number series..?

    Good evening Nilem,
    Thanks very much for your time ,yes thereis a solution but that code on your post #14 it needs to keep randomise columns "A and C" until it find solution it may take more than 30 min.
    here the solution for combin(9,3)=84 which you're trying to solve;
    RESULT
    01 02 03 04 05 08 06 07 09
    01 02 04 03 08 09 05 06 07
    01 02 05 03 07 09 04 06 08
    01 02 06 03 05 09 04 07 08
    01 02 07 03 06 08 04 05 09
    01 02 08 03 06 09 04 05 07
    01 02 09 03 07 08 04 05 06
    01 03 04 02 07 09 05 06 08
    01 03 05 02 06 07 04 08 09
    01 03 06 02 04 09 05 07 08
    01 03 07 02 04 08 05 06 09
    01 03 08 02 05 06 04 07 09
    01 03 09 02 04 05 06 07 08
    01 04 05 02 03 06 07 08 09
    01 04 06 02 03 07 05 08 09
    01 04 07 02 03 05 06 08 09
    01 04 08 02 06 09 03 05 07
    01 04 09 02 05 08 03 06 07
    01 05 06 02 07 08 03 04 09
    01 05 07 02 03 08 04 06 09
    01 05 08 02 03 09 04 06 07
    01 05 09 02 06 08 03 04 07
    01 06 07 02 08 09 03 04 05
    01 06 08 02 03 04 05 07 09
    01 06 09 02 05 07 03 04 08
    01 07 08 02 05 09 03 04 06
    01 07 09 02 04 06 03 05 08
    01 08 09 02 04 07 03 05 06
    Thanks again
    sem

  37. #37
    Forum Contributor
    Join Date
    01-21-2011
    Location
    London,UK
    MS-Off Ver
    Excel 2007
    Posts
    241

    Re: Vb code To Find the missing triplets and complete the number series..?

    Bump.???????

  38. #38
    Forum Contributor
    Join Date
    01-21-2011
    Location
    London,UK
    MS-Off Ver
    Excel 2007
    Posts
    241

    Re: Vb code To Find the missing triplets and complete the number series..?

    Bump.???????

  39. #39
    Forum Contributor
    Join Date
    01-21-2011
    Location
    London,UK
    MS-Off Ver
    Excel 2007
    Posts
    241

    Re: Vb code To Find the missing triplets and complete the number series..?

    much appreciate for Any Assistance ?

  40. #40
    Forum Contributor
    Join Date
    01-21-2011
    Location
    London,UK
    MS-Off Ver
    Excel 2007
    Posts
    241

    Re: Vb code To Find the missing triplets and complete the number series..?

    Bump.???????

  41. #41
    Forum Contributor
    Join Date
    01-21-2011
    Location
    London,UK
    MS-Off Ver
    Excel 2007
    Posts
    241

    Re: Vb code To Find the missing triplets and complete the number series..?

    Any Assistance,please ?

  42. #42
    Forum Contributor
    Join Date
    01-21-2011
    Location
    London,UK
    MS-Off Ver
    Excel 2007
    Posts
    241

    Re: Vb code To Find the missing triplets and complete the number series..?

    Bump.???????

  43. #43
    Forum Contributor
    Join Date
    01-21-2011
    Location
    London,UK
    MS-Off Ver
    Excel 2007
    Posts
    241

    Re: Vb code To Find the missing triplets and complete the number series..?

    Bump.???????

  44. #44
    Forum Contributor
    Join Date
    01-21-2011
    Location
    London,UK
    MS-Off Ver
    Excel 2007
    Posts
    241

    Re: Vb code To Find the missing triplets and complete the number series..?

    Bump.???????

+ 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