+ Reply to Thread
Results 1 to 32 of 32

Filtering, sorting and finding missing sequence using macro (for big Excel file)

  1. #1
    Forum Contributor
    Join Date
    01-25-2012
    Location
    CT
    MS-Off Ver
    Excel 2016
    Posts
    134

    Filtering, sorting and finding missing sequence using macro (for big Excel file)

    Hi All

    I have a very big Excel file (62 MB). I need to be able to filter by one column (FACILITY) and sort the whole file using the (REGISTRATION NO) column as well as finding the missing sequence number in the (REGISTRATION NO) column. The problem is that the (FACILITY) column has more than 200 different facility name. I am thinking of macro as I have different Spreadsheet I need to do the same steps in each one separately.

    I have attached a copy (example from the data that I have)


    Any help please.
    Attached Files Attached Files

  2. #2
    Forum Contributor
    Join Date
    01-25-2012
    Location
    CT
    MS-Off Ver
    Excel 2016
    Posts
    134

    Re: Filtering, sorting and finding missing sequence using macro (for big Excel file)

    Any help please.

  3. #3
    Forum Expert jaslake's Avatar
    Join Date
    02-21-2009
    Location
    Atwood Lake in Mid NE Ohio...look it up.
    MS-Off Ver
    Excel 2010 2019
    Posts
    12,749

    Re: Filtering, sorting and finding missing sequence using macro (for big Excel file)

    Hi TallOne

    Are these three separate tasks or are they somehow integrated?
    John

    If you have issues with Code I've provided, I appreciate your feedback.

    In the event Code provided resolves your issue, please mark your Thread as SOLVED.

    If you're satisfied by any members response to your issue please use the star icon at the lower left of their post.

  4. #4
    Forum Contributor
    Join Date
    01-25-2012
    Location
    CT
    MS-Off Ver
    Excel 2016
    Posts
    134

    Re: Filtering, sorting and finding missing sequence using macro (for big Excel file)

    Hi Jaslake,
    Thank you for your reply.
    They are integrated. I Need first to filter my data using (FACILITY) column, sort all the using the (Regards No) and then finds the missing sequence in the (Region No) column.

    Thanks again.

  5. #5
    Forum Expert jaslake's Avatar
    Join Date
    02-21-2009
    Location
    Atwood Lake in Mid NE Ohio...look it up.
    MS-Off Ver
    Excel 2010 2019
    Posts
    12,749

    Re: Filtering, sorting and finding missing sequence using macro (for big Excel file)

    Hi TallOne

    So, I Filter on ADRIAANSE CLINIC and get this...now what do you wish to happen...spell it out, step by step...at this point I'm not following.

    A
    B
    C
    D
    E
    F
    G
    H
    I
    1
    LAST UPDATED FACILITY REGISTRATION NO. GENDER AGE REGISTRATION DATE TREATMENT (RX) START DATE REGIMEN
    2
    418
    01/08/2012 ADRIAANSE CLINIC
    64
    Male
    38
    31/03/2010 24/03/2010 2: 2HRZES 1HRZE 5HRE - Reg 2
    3
    598
    01/08/2012 ADRIAANSE CLINIC
    31
    Female
    6
    10/02/2010 10/02/2010 3: 2HRZ 4HR - Reg 3
    4
    837
    01/08/2012 ADRIAANSE CLINIC
    27
    Male
    37
    08/02/2010 08/02/2010 1: 2HRZE 4HR - Reg 1
    5
    995
    01/08/2012 ADRIAANSE CLINIC
    229
    Male
    29
    25/10/2010 20/10/2010 1: 2HRZE 4HR - Reg 1

  6. #6
    Forum Contributor
    Join Date
    01-25-2012
    Location
    CT
    MS-Off Ver
    Excel 2016
    Posts
    134

    Re: Filtering, sorting and finding missing sequence using macro (for big Excel file)

    Hi Jaslake,
    After that I need to sort the using the (Regards No) column, then finding all the missing number in the (Region No).
    The data that I have is very big (more than 50000 rows and more than 200 columns). Also the (Facility) column has 200 different values (clinic name).

    Thanks again, I really appreciate your help.

  7. #7
    Forum Expert jaslake's Avatar
    Join Date
    02-21-2009
    Location
    Atwood Lake in Mid NE Ohio...look it up.
    MS-Off Ver
    Excel 2010 2019
    Posts
    12,749

    Re: Filtering, sorting and finding missing sequence using macro (for big Excel file)

    Hi TallOne

    OK, I've sorted ADRIAANSE CLINIC and get the attached...what Numbers are missing...1 to 26, 28 to 30, 32 to 63 and 65 to 228?

    If so, what kind of report do you want? Do you want that report for each of your 200 facilities? What if the Facility has only 1 Registration Number? Help me with the output you're looking for.
    A
    B
    C
    D
    E
    F
    G
    H
    I
    1
    LAST UPDATED FACILITY REGISTRATION NO. GENDER AGE REGISTRATION DATE TREATMENT (RX) START DATE REGIMEN
    2
    837
    01/08/2012 ADRIAANSE CLINIC
    27
    Male
    37
    08/02/2010 08/02/2010 1: 2HRZE 4HR - Reg 1
    3
    598
    01/08/2012 ADRIAANSE CLINIC
    31
    Female
    6
    10/02/2010 10/02/2010 3: 2HRZ 4HR - Reg 3
    4
    418
    01/08/2012 ADRIAANSE CLINIC
    64
    Male
    38
    31/03/2010 24/03/2010 2: 2HRZES 1HRZE 5HRE - Reg 2
    5
    995
    01/08/2012 ADRIAANSE CLINIC
    229
    Male
    29
    25/10/2010 20/10/2010 1: 2HRZE 4HR - Reg 1

  8. #8
    Forum Contributor
    Join Date
    01-25-2012
    Location
    CT
    MS-Off Ver
    Excel 2016
    Posts
    134

    Re: Filtering, sorting and finding missing sequence using macro (for big Excel file)

    Thanks for your quick reply and help.

    I want that for each facility, i.e, the same above steps. I need to use macro (if possible) because I have different spreadsheets with the same columns heading.

    Thanks again.

  9. #9
    Forum Expert jaslake's Avatar
    Join Date
    02-21-2009
    Location
    Atwood Lake in Mid NE Ohio...look it up.
    MS-Off Ver
    Excel 2010 2019
    Posts
    12,749

    Re: Filtering, sorting and finding missing sequence using macro (for big Excel file)

    Hi TallOne

    Dummy up an output File that demonstrates your desired output. Do so for 3 Facilities including ADRIAANSE CLINIC. I'm not getting the picture...paint it for me. What do you want the Output to be?


    The Filtering is not a problem; Sorting is not a problem; the Missing Numbers is not a problem depending on your answer to my question
    what Numbers are missing...1 to 26, 28 to 30, 32 to 63 and 65 to 228?
    Please respond to this question.

  10. #10
    Forum Contributor
    Join Date
    01-25-2012
    Location
    CT
    MS-Off Ver
    Excel 2016
    Posts
    134

    Re: Filtering, sorting and finding missing sequence using macro (for big Excel file)

    Hi
    Yes, these the number are missing in the facility.
    I do have output file for 10 facilities, that I did manually. Will try to delete some of the columns so that I can uploaded.

    Thanks again.

  11. #11
    Forum Contributor
    Join Date
    01-25-2012
    Location
    CT
    MS-Off Ver
    Excel 2016
    Posts
    134

    Re: Filtering, sorting and finding missing sequence using macro (for big Excel file)

    Hi again,
    The desired output:
    1- for each facility, identify the missing number in the (Region No) column.
    2- the output should be in new sheet; or new workbook.

    Hope that helps.

  12. #12
    Forum Expert jaslake's Avatar
    Join Date
    02-21-2009
    Location
    Atwood Lake in Mid NE Ohio...look it up.
    MS-Off Ver
    Excel 2010 2019
    Posts
    12,749

    Re: Filtering, sorting and finding missing sequence using macro (for big Excel file)

    Hi TallOne

    I'll wait until I see this...I'll just be guessing otherwise...
    I do have output file for 10 facilities, that I did manually.

  13. #13
    Forum Contributor
    Join Date
    01-25-2012
    Location
    CT
    MS-Off Ver
    Excel 2016
    Posts
    134

    Re: Filtering, sorting and finding missing sequence using macro (for big Excel file)

    Hi jaslake,

    Please see the attached file.

    I have only filtered by facility, and sorted the data using (Reg No) column, but I need to find the missing number in the (Reg No) column. After that I have to do some calculations and graphs, and I think I will be able to do so.

    Thanks again for your time and help
    Attached Files Attached Files

  14. #14
    Forum Expert jaslake's Avatar
    Join Date
    02-21-2009
    Location
    Atwood Lake in Mid NE Ohio...look it up.
    MS-Off Ver
    Excel 2010 2019
    Posts
    12,749

    Re: Filtering, sorting and finding missing sequence using macro (for big Excel file)

    Hi TallOne

    Modify this File for the "missing numbers".
    Attached Files Attached Files

  15. #15
    Forum Contributor
    Join Date
    01-25-2012
    Location
    CT
    MS-Off Ver
    Excel 2016
    Posts
    134

    Re: Filtering, sorting and finding missing sequence using macro (for big Excel file)

    Hi Jaslake,

    Here is the modified file with the "missing number". Is it possible to find the missed number instead of the way I did in the attached file.


    Thanks again for your time and help.
    Attached Files Attached Files

  16. #16
    Forum Contributor
    Join Date
    01-25-2012
    Location
    CT
    MS-Off Ver
    Excel 2016
    Posts
    134

    Re: Filtering, sorting and finding missing sequence using macro (for big Excel file)

    Hi All

    And is it possible to have the output in a new workbook.

    Thanks in advance

  17. #17
    Forum Expert jaslake's Avatar
    Join Date
    02-21-2009
    Location
    Atwood Lake in Mid NE Ohio...look it up.
    MS-Off Ver
    Excel 2010 2019
    Posts
    12,749

    Re: Filtering, sorting and finding missing sequence using macro (for big Excel file)

    Hi TallOne

    If you were to show me what you want the output to be perhaps it can be accommodated.
    Is it possible to find the missed number instead of the way I did in the attached file.
    I believe I've asked for this several times already and I'll not spend more time on your issue until you've defined what it is you want/need...sorry.

  18. #18
    Forum Contributor
    Join Date
    01-25-2012
    Location
    CT
    MS-Off Ver
    Excel 2016
    Posts
    134

    Re: Filtering, sorting and finding missing sequence using macro (for big Excel file)

    Hi Jaslake

    Please see the attached file (This the output that I can think of till now, my data is very big so I still have a lot work to do with it).

    Thank you very much for your time and help.
    Attached Files Attached Files

  19. #19
    Forum Expert jaslake's Avatar
    Join Date
    02-21-2009
    Location
    Atwood Lake in Mid NE Ohio...look it up.
    MS-Off Ver
    Excel 2010 2019
    Posts
    12,749

    Re: Filtering, sorting and finding missing sequence using macro (for big Excel file)

    Hi TallOne

    Do you want a new Workbook with ALL Facilities in the SAME Workbook or do you want a SEPARATE Workbook for EACH Facility?

  20. #20
    Forum Contributor
    Join Date
    01-25-2012
    Location
    CT
    MS-Off Ver
    Excel 2016
    Posts
    134

    Re: Filtering, sorting and finding missing sequence using macro (for big Excel file)

    Hi Jaslake,
    Thank you very much for your effort.
    All the facilities in the same workbook.

    Thanks again.

  21. #21
    Forum Expert jaslake's Avatar
    Join Date
    02-21-2009
    Location
    Atwood Lake in Mid NE Ohio...look it up.
    MS-Off Ver
    Excel 2010 2019
    Posts
    12,749

    Re: Filtering, sorting and finding missing sequence using macro (for big Excel file)

    Hi TallOne

    This Code is in the attached. It takes a bit of time to run and, of course, will take longer on your Actual File.

    Run the Code first on the attached Sample File to see if the results are as you described. CTRL + x will fire the Code. The Output File (named "Facilities") will be in the same Folder as the Sample File.
    Please Login or Register  to view this content.
    Attached Files Attached Files

  22. #22
    Forum Contributor
    Join Date
    01-25-2012
    Location
    CT
    MS-Off Ver
    Excel 2016
    Posts
    134

    Re: Filtering, sorting and finding missing sequence using macro (for big Excel file)

    Hi Jaslake,

    Thank you very much for your effort and help. I have checked just now, will play around it and let you know.

    Thanks again.

  23. #23
    Forum Contributor
    Join Date
    01-25-2012
    Location
    CT
    MS-Off Ver
    Excel 2016
    Posts
    134

    Re: Filtering, sorting and finding missing sequence using macro (for big Excel file)

    Hi Jaslake,

    It works fine, thanks a lot for your help.

    Is it possible to create a new workbook showing the missing sequence for each facility (Please see the output I am looking for)


    Thank you again.
    Attached Files Attached Files

  24. #24
    Forum Expert jaslake's Avatar
    Join Date
    02-21-2009
    Location
    Atwood Lake in Mid NE Ohio...look it up.
    MS-Off Ver
    Excel 2010 2019
    Posts
    12,749

    Re: Filtering, sorting and finding missing sequence using macro (for big Excel file)

    Hi TallOne

    Those numbers in your Sample File mean nothing to me...where do they come from...what do they represent? Tie them to the actual output from the File we're working with so I can understand what they mean.

  25. #25
    Forum Contributor
    Join Date
    01-25-2012
    Location
    CT
    MS-Off Ver
    Excel 2016
    Posts
    134

    Re: Filtering, sorting and finding missing sequence using macro (for big Excel file)

    Hi Jaslake,

    Thank you for reply.

    What I meant is that: the missing sequence that you calculated; I want them to be in a new workbook (missing sequence per facility).

    The number in the previous attached was only to show you the output that I'm looking for.

    Thanks again.

  26. #26
    Forum Contributor
    Join Date
    01-25-2012
    Location
    CT
    MS-Off Ver
    Excel 2016
    Posts
    134

    Re: Filtering, sorting and finding missing sequence using macro (for big Excel file)

    Hi Jaslake,

    Please see the attached file (the output I am looking for using the data we were working with)


    Thanks again
    Attached Files Attached Files

  27. #27
    Forum Contributor
    Join Date
    01-25-2012
    Location
    CT
    MS-Off Ver
    Excel 2016
    Posts
    134

    Re: Filtering, sorting and finding missing sequence using macro (for big Excel file)

    Any help please.

  28. #28
    Forum Expert jaslake's Avatar
    Join Date
    02-21-2009
    Location
    Atwood Lake in Mid NE Ohio...look it up.
    MS-Off Ver
    Excel 2010 2019
    Posts
    12,749

    Re: Filtering, sorting and finding missing sequence using macro (for big Excel file)

    Hi TallOne

    I'm going to be tied up a bit...get back to it as soon as I can...

  29. #29
    Forum Expert jaslake's Avatar
    Join Date
    02-21-2009
    Location
    Atwood Lake in Mid NE Ohio...look it up.
    MS-Off Ver
    Excel 2010 2019
    Posts
    12,749

    Re: Filtering, sorting and finding missing sequence using macro (for big Excel file)

    Hi TallOne

    Try the Code in the attached...
    Attached Files Attached Files

  30. #30
    Forum Contributor
    Join Date
    01-25-2012
    Location
    CT
    MS-Off Ver
    Excel 2016
    Posts
    134

    Re: Filtering, sorting and finding missing sequence using macro (for big Excel file)

    Hi Jaslake,

    That was perfect, exactly what I am looking for.

    Thank you for your help and time really appreciated.

  31. #31
    Forum Contributor
    Join Date
    01-25-2012
    Location
    CT
    MS-Off Ver
    Excel 2016
    Posts
    134

    Re: Filtering, sorting and finding missing sequence using macro (for big Excel file)

    Hi Again,

    I was trying to sort out this problem and I came up with this code, but yours is perfect. I just want to share it with others

    Please Login or Register  to view this content.

  32. #32
    Forum Expert jaslake's Avatar
    Join Date
    02-21-2009
    Location
    Atwood Lake in Mid NE Ohio...look it up.
    MS-Off Ver
    Excel 2010 2019
    Posts
    12,749

    Re: Filtering, sorting and finding missing sequence using macro (for big Excel file)

    You're welcome...glad I could help. Thanks for the Rep.

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. Macro to add missing numbers in a sequence
    By webfeet2 in forum Excel Programming / VBA / Macros
    Replies: 6
    Last Post: 07-10-2015, 10:34 AM
  2. Finding missing dates with time in sequence
    By yuvrajcbe in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 04-03-2014, 08:29 AM
  3. Sorting and filtering is missing cells
    By owenpga in forum Excel General
    Replies: 0
    Last Post: 12-21-2012, 09:56 AM
  4. Sorting two groups of columns and finding missing data from each
    By mchudnvosky in forum Excel Programming / VBA / Macros
    Replies: 8
    Last Post: 01-30-2010, 10:55 AM
  5. Finding numbers missing from a sequence
    By andy in forum Excel General
    Replies: 4
    Last Post: 04-08-2005, 12:06 PM

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