How to automatically sort data collections based on date

Anonymous
2023-11-08T12:58:44+00:00

Hello,

I have an excel file with information regarding equipment, having one equipment per row.

Information about the equipment expands from column A to N, where N is a variable date (date for next maintenance service of equipment, once maintenance occur this date is updated with the date for the next maintenance to occur).

I want the data collection to be sorted by "next maintenance date", but I am not able to get this to happen automatically when the date is changed. When I update the next maintenance date for an equipment (in the sorted list), the equipment row will not locate into its new correct position (based on date).

Is there a solution to this problem?

Thanks in advance.

Kind regards,

Renate

Microsoft 365 and Office | Excel | Other | Windows

Locked Question. This question was migrated from the Microsoft Support Community. You can vote on whether it's helpful, but you can't add comments or replies or follow the question.

0 comments No comments
{count} votes

24 answers

Sort by: Most helpful
  1. Anonymous
    2023-11-16T14:35:51+00:00

    Hi,

    Thank you very much for your answer. It works perfectly, except I am not able to get the orange colour to work. No matter what colour code I put in here for the code representing "one month in advance", it just turns out light green. I can however live with that, unless you see an easy explanation for it. When I try to change colours for the other dates, it works perfectly, so the only problem is this field.

    Kind regards,

    Renate

    0 comments No comments
  2. Anonymous
    2023-11-16T15:08:19+00:00

    It works perfectly, except I am not able to get the orange colour to work. No matter what colour code I put in here for the code representing "one month in advance", it just turns out light green.

    Then, you have changed the code, I think.

    Note: The macro only checks whether a date belongs to the current month, to one of the following months, or to one of the previous months (as you asked). The day is not taken into account!

    0 comments No comments
  3. Anonymous
    2023-11-21T12:26:33+00:00

    Hi again,

    I have transferred the excel file over to SharePoints, however, the codes did not get included when I uploaded the file to sharepoint. It seems like the codes are not sheet-specific anymore, as the code field does not change when I switch between sheets. I tried to copy to code for sheet 1 into the new code field in sharepoint, this did not work at all, see pictures below of the code and failure messages.

    I would really appreciate it if you have any suggestions here.

    Kind regards,

    Renate

    0 comments No comments
  4. Anonymous
    2023-11-22T10:47:18+00:00

    I cannot help you with Sharepoints. But as far as your Excel file is concerned, there must be something wrong with your file. Have you checked that no conditional formatting is set in columns L and/or M ? You cannot use the macro and conditional formatting together !

    0 comments No comments