+ Reply to Thread
Results 1 to 8 of 8

I want to search and delete combinations of 4 specific numbers stored in 5 colums

  1. #1
    Registered User
    Join Date
    01-03-2013
    Location
    Bucharest
    MS-Off Ver
    Excel 2003
    Posts
    6

    I want to search and delete combinations of 4 specific numbers stored in 5 colums

    Untitled.jpg

    I attacked a photo so you can see the setup of my worksheet. It goes till the row 65000. I want to delete the combinations between the numbers from CC1:CF1 and another number from the range of 1 till 40. I have a program that doesnt delete them all and i was wondering if u guys can help me. This program deletes only some combinations , for example if i have 1 2 3 4 ( the choosen numbers ) it will delete all the combinations. but if i have 2 3 4 5 it wont delete the combination
    1 2 3 4 5 , or if i have 2 4 5 6 it wont delete the combinations 1 2 4 5 6 or 2 3 4 5 6. I hope i was clear enough and u will find the problem with the code. I will attach the code. Thx in advance

    code.txt

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

    Re: I want to search and delete combinations of 4 specific numbers stored in 5 colums

    That was the code I have written somewhere.

    Upload a file with the data and your desired result.

  3. #3
    Registered User
    Join Date
    01-03-2013
    Location
    Bucharest
    MS-Off Ver
    Excel 2003
    Posts
    6

    Re: I want to search and delete combinations of 4 specific numbers stored in 5 colums

    Yea, u made the code :D...i tried to contact you again but didnt reach you. http://www.ozgrid.com/forum/showthre...=169144&page=4
    Here is the link with the old post. There is also a link with the file. Like you said its very slow. The code doesnt delete the combinations with the numbers that are lower than the numbers i choose or that are between them . Example: if i choose
    5 6 8 10 ...he will delete only 5 6 8 10 11 and so on till 40 ----> and will elude 1 5 6 8 10,2 5 6 8 10, 3 5 6 8 104 5 6 8 10 and also 5 6 8 9 10.

  4. #4
    Registered User
    Join Date
    01-03-2013
    Location
    Bucharest
    MS-Off Ver
    Excel 2003
    Posts
    6

    Re: I want to search and delete combinations of 4 specific numbers stored in 5 colums

    Yea, u made the code :D...i tried to contact you again but didnt reach you. [URL="http://www.ozgrid.com/forum/showthread.php?t=169144&page=4"]
    Here is the link with the old post. There is also a link with the file. Like you said its very slow. The code doesnt delete the combinations with the numbers that are lower than the numbers i choose or that are between them . Example: if i choose
    5 6 8 10 ...he will delete only 5 6 8 10 11 and so on till 40 ----> and will elude 1 5 6 8 10,2 5 6 8 10, 3 5 6 8 104 5 6 8 10 and also 5 6 8 9 10.

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

    Re: I want to search and delete combinations of 4 specific numbers stored in 5 colums

    Again, no idea what you are talking about.

    Upload a file with the small data and your desired result.

  6. #6
    Registered User
    Join Date
    01-03-2013
    Location
    Bucharest
    MS-Off Ver
    Excel 2003
    Posts
    6

    Re: I want to search and delete combinations of 4 specific numbers stored in 5 colums

    Couldnt attach here...it says its to big. 2.5MB . http://www.4shared.com/file/PGMu30OD/sample.html
    here is the link where i uploaded the sample

  7. #7
    Registered User
    Join Date
    01-03-2013
    Location
    Bucharest
    MS-Off Ver
    Excel 2003
    Posts
    6

    Re: I want to search and delete combinations of 4 specific numbers stored in 5 colums

    Did you understood what i want jindon? Can you do it? :D.

  8. #8
    Registered User
    Join Date
    01-03-2013
    Location
    Bucharest
    MS-Off Ver
    Excel 2003
    Posts
    6

    Re: I want to search and delete combinations of 4 specific numbers stored in 5 colums

    Attachment 206352 I attached a print screen so you can see how i got that huge combination numbers. There are 658008 combinations (each has 5 numbers in range of 1 to 40).

    FIRST TRY TO EXPLAIN:

    I will try to explain how i will do it manually maybe you understand how to program it.
    Now i have a set of 4 numbers (each different, also in the range of 1 to 40), to this numbers i will add another number from the rest of 36 remaining one at a time. And with the resulted 36 combinations i will search them each in the whole 658008 combinations and when i find them i delete them. For example i will pick this 4 numbers : 10 11 14 15 i hope this will be relevant enough :D.
    The combinations that are NOT BOLD or Underline are the combinations that the OLD program already delets.
    I dont have programming skills but i noticed that the program has flaws (doesnt delete all the combinations) when my smallest number is not 1(Bolded numbers) and when the numbers are not consecutive (underlined numbers). I think some IF's should resolve this problem...something like IF my smallest number is not 1 then the program should start the combination with 1, then it should go to the number 2 and check if that is my number, and so on (in my example it will go till 9 cause my smallest number is 10----> Bolded combinations), when it reaches 10 it should check with an IF if my next number is the consecutive number of 10 (in my example it is, cause the number is 11) and if it is go to the third number and see if its the consecutive number of 11 (in my example it is not cause the third number is 14 and the program will need to add the number 12 and then 13----> underlined combinations), next comes the fourth number and check if its consecutive of the previous one (and it is cause its 15), if it is, then the OLD program already does this and deletes all the combinations with the next numbers till 40( using the consecutive numbers from the last number i picked which is the biggest till the last number which is 40)
    1 10 11 14 15
    2 10 11 14 15
    3 10 11 14 15
    4 10 11 14 15
    5 10 11 14 15
    6 10 11 14 15
    7 10 11 14 15
    8 10 11 14 15
    9 10 11 14 15

    10 11 12 14 15
    10 11 13 14 15

    10 11 14 15 16
    10 11 14 15 17
    10 11 14 15 18
    10 11 14 15 19
    10 11 14 15 20
    10 11 14 15 21
    10 11 14 15 22
    10 11 14 15 23
    10 11 14 15 24
    10 11 14 15 25
    10 11 14 15 26
    10 11 14 15 27
    10 11 14 15 28
    10 11 14 15 29
    10 11 14 15 30
    10 11 14 15 31
    10 11 14 15 32
    10 11 14 15 33
    10 11 14 15 34
    10 11 14 15 35
    10 11 14 15 36
    10 11 14 15 37
    10 11 14 15 38
    10 11 14 15 39
    10 11 14 15 40

    SECOND TRY (IF FIRST FAILED :D)

    Now, i have this numbers 9 13 17 25 which will be bolded in the example so you can see easily what i want. I need the program to delete combination of 5 that include my 4 numbers.
    These are ( 1 to 8) 9 (10 to 12) 13 (14 to 16) 17 (18 to 24) 25 (16 to 40).
    Example:

    The Underlined are the combinations that the OLD program eludes to delete.

    1 9 13 17 25
    2 9 13 17 25
    3 9 13 17 25
    4 9 13 17 25
    5 9 13 17 25
    6 9 13 17 25
    7 9 13 17 25
    8 9 13 17 25

    9 10 13 17 25
    9 11 13 17 25
    9 12 13 17 25

    9 13 14 17 25
    9 13 15 17 25
    9 13 16 17 25

    9 13 17 18 25
    9 13 17 19 25
    9 13 17 20 25
    9 13 17 21 25
    9 13 17 22 25
    9 13 17 23 25
    9 13 17 24 25


    9 13 17 25 26
    9 13 17 25 27
    9 13 17 25 28
    9 13 17 25 29
    9 13 17 25 30
    9 13 17 25 31
    9 13 17 25 32
    9 13 17 25 33
    9 13 17 25 34
    9 13 17 25 35
    9 13 17 25 36
    9 13 17 25 37
    9 13 17 25 38
    9 13 17 25 39
    9 13 17 25 40

    If you have anymore questions or dont understand something please send me a message or post in this thread.

    The full excel worksheet is here if you need it http://www.4shared.com/office/DOZ9-z4e/Fill_Fast.html?

    I really want to thank you for your time spent on this, and not only this, in the name of all people you helped. THANK YOU
    If all people would help each other this would be a better world.

+ 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