+ Reply to Thread
Results 1 to 27 of 27

Categorize items by status of completed, open

  1. #1
    Forum Contributor
    Join Date
    05-16-2018
    Location
    SG
    MS-Off Ver
    2013
    Posts
    217

    Categorize items by status of completed, open

    Hi

    I have a workbook where by Rows 3,7, 50, 86, 126 and 254 are created as cascading cells when I double click. I could use some assistance with the VBA to be able to push the data by status for “open” to the top rows by earliest date followed by the “completed” items to the below rows within each year cascading group. I think we could use the first row in each cascading group as a data entry row. I have input a sample on the worksheet on expected results. Hope I can get some help on this. Will greatly appreciate it.
    Attached Files Attached Files

  2. #2
    Forum Expert
    Join Date
    12-14-2012
    Location
    London England
    MS-Off Ver
    MS 365 Office Suite.
    Posts
    8,448

    Re: Categorize items by status of completed, open

    This should be quite easy.

    Give me ten minutes.


    My Apologies..... Work

    Change your Macro to this:=

    Please Login or Register  to view this content.
    Last edited by mehmetcik; 01-14-2019 at 09:17 AM.
    My General Rules if you want my help. Not aimed at any person in particular:

    1. Please Make Requests not demands, none of us get paid here.

    2. Check back on your post regularly. I will not return to a post after 4 days.
    If it is not important to you then it definitely is not important to me.

  3. #3
    Forum Contributor
    Join Date
    05-16-2018
    Location
    SG
    MS-Off Ver
    2013
    Posts
    217

    Re: Categorize items by status of completed, open

    Hi Mmehmetcik,

    Thank you very much for your help on working on this code.I need advice on 3 things. There seem to be a debug error on the VBA. I've attached the file with the pasted code. Can i also check on the VBA code, the status sorted based on the values of "completed' and "opened" are not on the code. Can i know where are the values represented. My last enquiry would be after i data entry in each cascading group will the rows get automatically sorted or will i need to key in the first row of each cascading group to automate the sorting?
    Attached Files Attached Files

  4. #4
    Forum Expert
    Join Date
    12-14-2012
    Location
    London England
    MS-Off Ver
    MS 365 Office Suite.
    Posts
    8,448

    Re: Categorize items by status of completed, open

    The Columns are sorted by Status Descending Z-A
    Date Ascending A-Z

    Collapsing or Opening a range will sort the data.

    I suppose you can trigger the sort Macro on deactivation or on workbook close

    Try this code instead.

    Please Login or Register  to view this content.
    Last edited by mehmetcik; 01-14-2019 at 05:59 PM.

  5. #5
    Forum Contributor
    Join Date
    05-16-2018
    Location
    SG
    MS-Off Ver
    2013
    Posts
    217

    Re: Categorize items by status of completed, open

    Hi mehmetcik,

    I seem to be having a debug error with the second code on the same below line. Can i ask if i am missing out something?

    Please Login or Register  to view this content.
    Attached Files Attached Files

  6. #6
    Forum Expert
    Join Date
    12-14-2012
    Location
    London England
    MS-Off Ver
    MS 365 Office Suite.
    Posts
    8,448

    Re: Categorize items by status of completed, open

    Delete those comments

    Then try this code:

    Please Login or Register  to view this content.

  7. #7
    Forum Contributor
    Join Date
    05-16-2018
    Location
    SG
    MS-Off Ver
    2013
    Posts
    217

    Re: Categorize items by status of completed, open

    Hi mehmetcik

    I have reattempted by deleting the previous code and pasting the code from message 5 as attached on sheet1. It's not functioning and the collapsible function is not working as well. Could i bother you abit to take a look at the file to see if i have done the correct steps. Thanks!!
    Attached Files Attached Files

  8. #8
    Forum Expert
    Join Date
    12-14-2012
    Location
    London England
    MS-Off Ver
    MS 365 Office Suite.
    Posts
    8,448

    Re: Categorize items by status of completed, open

    You did not delete the comments.
    Attached Files Attached Files

  9. #9
    Forum Contributor
    Join Date
    05-16-2018
    Location
    SG
    MS-Off Ver
    2013
    Posts
    217

    Re: Categorize items by status of completed, open

    Hi mehmetcik,

    Sorry I don't get it. I can't find any comments on the code or on the file. Which cell are we referring to? On your attachment for testbook2 I faced the same issue again. When i double click on the collapsible cells in rows 3, 7, 50, 86, 126, 254, i encounter an error message on this particular line of code. The error reads as object doesn't support this property or method and points to the code after i debug. I'm sure not doing something correct. Please assist to advice.

    Please Login or Register  to view this content.

  10. #10
    Forum Expert
    Join Date
    12-14-2012
    Location
    London England
    MS-Off Ver
    MS 365 Office Suite.
    Posts
    8,448

    Re: Categorize items by status of completed, open

    It works perfectly here.

    Are you trying to change the sheet names? That line is trying to Sort sheet1 it would fail at that point if sheet1 does not exist.

  11. #11
    Forum Contributor
    Join Date
    05-16-2018
    Location
    SG
    MS-Off Ver
    2013
    Posts
    217

    Re: Categorize items by status of completed, open

    Hmm thats the thing. I did not change anything. I just clicked your excel sheet testbook2 and when i clicked the collapsible rows to expand, the error message auto prompts. I have tried copying the vba and module exactly into a new worksheet with the sheet still name "sheet1" and created the collapsible rows in Rows 3,7, 50, 86, 126 and 254 and i faced the error on the exact same spot in the code. I am stuck at this roadblock. Capture.JPG

  12. #12
    Forum Expert
    Join Date
    12-14-2012
    Location
    London England
    MS-Off Ver
    MS 365 Office Suite.
    Posts
    8,448

    Re: Categorize items by status of completed, open

    Try getting rid of references to the Active workbook and worksheet


    Please Login or Register  to view this content.

  13. #13
    Forum Contributor
    Join Date
    05-16-2018
    Location
    SG
    MS-Off Ver
    2013
    Posts
    217

    Re: Categorize items by status of completed, open

    Hi Mehmetcik,

    I have done that. I broke the link to the references to the previous workbook. i pasted the new code and the error showed up on this line. i seemed to realise that the error always happens when i double click the collapsible rows. Sry am at wits end...

    Please Login or Register  to view this content.

  14. #14
    Forum Contributor
    Join Date
    05-16-2018
    Location
    SG
    MS-Off Ver
    2013
    Posts
    217

    Re: Categorize items by status of completed, open

    Hi Mehmetcik,

    Can i suggest would you be able to copy the vba into a brand new workbook with the same number of columns. I can try to see if that works when i expand the rows and the data auto sorts.

  15. #15
    Forum Expert
    Join Date
    12-14-2012
    Location
    London England
    MS-Off Ver
    MS 365 Office Suite.
    Posts
    8,448

    Re: Categorize items by status of completed, open

    Same here.

    It works perfectly.

    Do you have any other macros running?

    Try unhiding and closing your personal workbook

  16. #16
    Forum Contributor
    Join Date
    05-16-2018
    Location
    SG
    MS-Off Ver
    2013
    Posts
    217

    Re: Categorize items by status of completed, open

    No other macros running. just this one workbook is opened. I've opened and closed it. faced the error again. Sry man.

  17. #17
    Forum Expert
    Join Date
    12-14-2012
    Location
    London England
    MS-Off Ver
    MS 365 Office Suite.
    Posts
    8,448

    Re: Categorize items by status of completed, open

    Ok.


    Lets get back to basics.

    Try this Macro and tell me if it works. The sort functionality is disabled.

    Ahh....... Maybe the problem is in sorting a hidden range.


    Please Login or Register  to view this content.




    Maybe this version


    Please Login or Register  to view this content.
    Last edited by mehmetcik; 01-15-2019 at 11:35 AM.

  18. #18
    Forum Contributor
    Join Date
    05-16-2018
    Location
    SG
    MS-Off Ver
    2013
    Posts
    217

    Re: Categorize items by status of completed, open

    Ok i pasted the first code and it worked for collapsing and expanding the rows. No errors encountered. The sorting did not happen.
    I removed the first code and pasted the second code and the same error occurred when i clicked on the collectible rows. I have attached the file with the first code pasted on it.
    Attached Files Attached Files

  19. #19
    Forum Expert
    Join Date
    12-14-2012
    Location
    London England
    MS-Off Ver
    MS 365 Office Suite.
    Posts
    8,448

    Re: Categorize items by status of completed, open

    Paste this code and then double click on 2011


    Please Login or Register  to view this content.
    Last edited by mehmetcik; 01-15-2019 at 09:18 PM.

  20. #20
    Forum Contributor
    Join Date
    05-16-2018
    Location
    SG
    MS-Off Ver
    2013
    Posts
    217

    Re: Categorize items by status of completed, open

    Hi Mehmetcik

    Which code you are referring to? The first one or the second one in post 17?

  21. #21
    Forum Contributor
    Join Date
    05-16-2018
    Location
    SG
    MS-Off Ver
    2013
    Posts
    217

    Re: Categorize items by status of completed, open

    Hi Mehmetcik

    I have pasted the code in post#19. When I collasped the group of 2011 there was no error but when i expanded the error happened on this line. No sorting was done as well.

    Please Login or Register  to view this content.

  22. #22
    Forum Expert
    Join Date
    12-14-2012
    Location
    London England
    MS-Off Ver
    MS 365 Office Suite.
    Posts
    8,448

    Re: Categorize items by status of completed, open

    Is your sheet name still Sheet1?

    I do not understand why the sort is not working.

  23. #23
    Forum Contributor
    Join Date
    05-16-2018
    Location
    SG
    MS-Off Ver
    2013
    Posts
    217

    Re: Categorize items by status of completed, open

    Hi Mehmetcik. Yes it is still called sheet1. No change on that. Is there any other way we can amend the vba to achieve this intended result with the expandable rows?

  24. #24
    Forum Expert
    Join Date
    12-14-2012
    Location
    London England
    MS-Off Ver
    MS 365 Office Suite.
    Posts
    8,448

    Re: Categorize items by status of completed, open

    Can you record yourself sorting some data on the sheet?, using the macro recorder.
    Then run thev macro.

    If it works then post it for me to look at.

  25. #25
    Forum Contributor
    Join Date
    05-16-2018
    Location
    SG
    MS-Off Ver
    2013
    Posts
    217

    Re: Categorize items by status of completed, open

    Hi Mehmetcik,

    This is the code. i sorted the data at the 2011 row. Thank you again for looking at this.

    If there is no other alternative then i guess i can instead create tabs for each year then... Will you be able to show me which code should i amend then if i am not using the expandable/collapsible rows and just auto sort to push completed below and opened to the top.

    Please Login or Register  to view this content.
    Last edited by michael35; 01-17-2019 at 08:30 AM.

  26. #26
    Forum Expert
    Join Date
    12-14-2012
    Location
    London England
    MS-Off Ver
    MS 365 Office Suite.
    Posts
    8,448

    Re: Categorize items by status of completed, open

    Ok

    Paste this code. Then click on 2011

    Please Login or Register  to view this content.

  27. #27
    Forum Contributor
    Join Date
    05-16-2018
    Location
    SG
    MS-Off Ver
    2013
    Posts
    217

    Re: Categorize items by status of completed, open

    Hi Mehmetcik

    Apologies to be away for a while. this worked like u mentioned when rows 8 to 49 are visible. Can i check how do i make the same sort function work for rows thereafter row 49.

+ 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. how to find Ref numbers which has not completed status
    By prabhuduraraj09 in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 11-10-2017, 01:12 AM
  2. Replies: 10
    Last Post: 06-01-2015, 08:41 AM
  3. Replies: 2
    Last Post: 08-13-2014, 09:48 AM
  4. [SOLVED] Need a formula to capture the completed status for a relevant data
    By Was2014 in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 04-02-2014, 11:47 AM
  5. [SOLVED] Move a row to another sheet after status says completed
    By rjclampitt in forum Excel Programming / VBA / Macros
    Replies: 6
    Last Post: 11-10-2012, 06:32 PM
  6. [SOLVED] Auto Move Rows when status is completed
    By razprod in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 08-23-2012, 01:40 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