+ Reply to Thread
Results 1 to 12 of 12

Trying to make millions :)

  1. #1
    Registered User
    Join Date
    09-28-2007
    Posts
    7

    Trying to make millions :)

    Hi there! I've got a range of number sets that i would like to filter. I want to be able to remove sets based on whether they have sequential numbers in them. i.e remove all sets with 4 consecutive numbers within the set. eg. 1,2,3,4,15,34 or 5,6,7,8,12,17 if you get my drift.
    I've attached a sample file.
    Would appreciate any advice. Thanks.
    Attached Files Attached Files

  2. #2
    Registered User
    Join Date
    09-28-2007
    Posts
    7

    still trying

    This really difficult...would appreciate any advice

  3. #3
    Forum Contributor VBA Noob's Avatar
    Join Date
    04-25-2006
    Location
    London, England
    MS-Off Ver
    xl03 & xl 07(Jan 09)
    Posts
    11,988
    Is this what you mean

    VBA Noob
    Attached Files Attached Files
    _________________________________________


    Credo Elvem ipsum etian vivere
    _________________________________________
    A message for cross posters

    Please remember to wrap code.

    Forum Rules

    Please add to your signature if you found this link helpful. Excel links !!!

  4. #4
    Registered User
    Join Date
    09-28-2007
    Posts
    7

    Still trying

    Hi VBA Noob.

    Not really. I want to filter out any of those cells that contain sets of numbers with x number of consecutive numbers. i.e. a cell has 1,2,3,6,8,9 and the one below it has 1,2,3,4,6,13. I would like to be able to filter out the cell with 4 consecutive numbers - (1,2,3,4,6,13) (or with 3,4,5 or 6 consecutive numbers as the user wishes).

    Thanks for looking at it for me. I hit a wall with it

  5. #5
    Forum Contributor VBA Noob's Avatar
    Join Date
    04-25-2006
    Location
    London, England
    MS-Off Ver
    xl03 & xl 07(Jan 09)
    Posts
    11,988
    Maybe

    VBA Noob
    Attached Files Attached Files
    Last edited by VBA Noob; 09-29-2007 at 06:26 AM.

  6. #6
    Forum Expert daddylonglegs's Avatar
    Join Date
    01-14-2006
    Location
    England
    MS-Off Ver
    2016
    Posts
    14,675
    If you use Data > Text to columns to split the numbers into 6 columns, i.e. A to F then you could use this formula in G1 copied down to give the number of consecutive numbers in each row (this assumes numbers would always be listed in ascending order)

    =SUMPRODUCT(--(B1:F1-A1:E1=1))+1

    You could then filter by this column, if you wish, to see sets with 4 consecutive numbers, or use a COUNTIF formula to count them

  7. #7
    Registered User
    Join Date
    09-28-2007
    Posts
    7

    lots of data

    Hello

    Thank you for all your advce to date. The problem with seperating the values is that i'm actually dealing with a huge amount of data and im not sure it would be practical to do that. Ideally, i would like a user to be able to enter a number of consecutive numbers i.e 3 or 4 or 5, and upon executing, any of the cells that don't have that number of consecutive numbers are moved perhaps to another sheet.

    Thank you all again.

  8. #8
    Forum Contributor VBA Noob's Avatar
    Join Date
    04-25-2006
    Location
    London, England
    MS-Off Ver
    xl03 & xl 07(Jan 09)
    Posts
    11,988
    Does this help

    Drop down in D1. Just number and press macro

    VBA Noob
    Attached Files Attached Files

  9. #9
    Registered User
    Join Date
    09-28-2007
    Posts
    7

    We are nearly there

    Hi VBA Noob

    I really hope I'm not frustrating you with this, I really appreciate your help and I will be able to use what you've done I'm sure.
    Where you have put the combo box, the user would select 3 or 4 or 5 or 10 or whatever (ie. this is the number of consecutive numbers in each cell. The cell might have the numbers 28,29,30,35,38,40 in it. Selecting 3 from the list would filter this cell out. i.e. 28,29,30 = 3 consecutive numbers).

    Sorry if I haven't been very clear...bit of a novice.

  10. #10
    Forum Contributor VBA Noob's Avatar
    Join Date
    04-25-2006
    Location
    London, England
    MS-Off Ver
    xl03 & xl 07(Jan 09)
    Posts
    11,988
    I'm sorry too.

    Won't be able to help you then as not sure how you would do that. Would of being nice to known early that you wanted to enter 3 instead of 3, 4, 5 etc

    VBA Noob

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

    See if this is getting closer. There is a UDF in the file so you will have to allow the macros when opening.

    You will have to put the number of sequential items into C1. If you have an existing filter, then you will have to turn it off, then refilter. Your data will also need to have the current separator of ", " (ie a comma followed by a space).

    rylo
    Attached Files Attached Files

  12. #12
    Registered User
    Join Date
    09-28-2007
    Posts
    7

    Talking Thanks

    thanks Rylo

    Thats great...I think I can take it from there. Thanks alot for your help!!

+ 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