+ Reply to Thread
Results 1 to 9 of 9

Automatic Sorting after adding a new row entry

  1. #1
    Registered User
    Join Date
    05-03-2017
    Location
    UK
    MS-Off Ver
    2010
    Posts
    12

    Automatic Sorting after adding a new row entry

    Hi,

    I am in the process of creating a task manager and would like the sheet to sort in a particular order. I can get this working with the Sort function in Excel but this only sorts what is currently there but when I add a new row, this is not sorted and I need to click the Sort button again to refresh the sort.

    The order I'd like for it to appear is:

    Red Cells (Tasks not started)
    Orange Cells (Ongoing tasks)
    Green Cells (Completed)
    And finally... a newest to oldest newest for the Green cells

    This is how I currently have it set:
    image001.png

    Could someone assist in pointing me in the direction or what Macros or VBA I could use to achieve this.

    Thanks in advance, greatly appreciated.

    Aarron

  2. #2
    Forum Expert Logit's Avatar
    Join Date
    12-23-2012
    Location
    North Carolina
    MS-Off Ver
    Excel 2019 Professional Plus - 2007 Enterprise
    Posts
    7,014

    Re: Automatic Sorting after adding a new row entry

    .
    This macro (paste in the Sheet module) will auto sort Col F when something new is added. You can edit the column to suit.

    Please Login or Register  to view this content.

  3. #3
    Forum Expert Logit's Avatar
    Join Date
    12-23-2012
    Location
    North Carolina
    MS-Off Ver
    Excel 2019 Professional Plus - 2007 Enterprise
    Posts
    7,014

    Re: Automatic Sorting after adding a new row entry

    .
    Also for the conditional formatting review this resource :

    https://stackoverflow.com/questions/...t-row/16831756


    This response is located about half-way down the page :



    I agree with what has been posted previously; copy and paste values (or paste formulas) will totally work to not split up the conditional formatting.

    I'm a little lazy for that. And I don't want those who use my spreadsheets to have to do that. I'm also not confident that they will remember to do copy and paste values.

    I don't know if this solution will work for your needs, but I resorted to deleting all conditional formatting and reapplying the correct conditional formatting every time the workbook is opened.

    Because this macro runs every time the workbook is opened, the user does not need to change the way they copy and paste. They don't need to know that the macro is even there. They don't need to manually run the macro; it is automatic. I feel this creates a better user experience.

    Please keep in mind that this code needs to be copied and pasted into the "This Workbook" module; not a regular module.

    Please Login or Register  to view this content.
    answered Sep 14 '18 at 16:58 by : irockyoursocks

  4. #4
    Registered User
    Join Date
    05-03-2017
    Location
    UK
    MS-Off Ver
    2010
    Posts
    12
    Many thanks for this, I dont suppose you have a sheet to share showing this in action as Im not totally confident on what I amend to sort it the way I'd like, sorry newbie to all this but appreciate your help.
    Last edited by jeffreybrown; 03-22-2019 at 09:19 PM. Reason: Removed full quote!

  5. #5
    Forum Expert Logit's Avatar
    Join Date
    12-23-2012
    Location
    North Carolina
    MS-Off Ver
    Excel 2019 Professional Plus - 2007 Enterprise
    Posts
    7,014

    Re: Automatic Sorting after adding a new row entry

    Which column are you sorting on ?

  6. #6
    Registered User
    Join Date
    05-03-2017
    Location
    UK
    MS-Off Ver
    2010
    Posts
    12
    I have attached the sheet. Im mostly just wanting the colours sorting so red first.. then orange and then green. Its column H for the colours and then as a final sort after the colours the rest of the greens to be sorted by newest first (this not important though) thank you for you help


    Quote Originally Posted by Logit View Post
    Which column are you sorting on ?
    Attached Files Attached Files
    Last edited by Aarron2; 03-23-2019 at 05:01 AM.

  7. #7
    Forum Expert Logit's Avatar
    Join Date
    12-23-2012
    Location
    North Carolina
    MS-Off Ver
    Excel 2019 Professional Plus - 2007 Enterprise
    Posts
    7,014

    Re: Automatic Sorting after adding a new row entry

    .
    Using Column H (that has the colors) and running the Macro Recorder .... this is the macro it created :

    Please Login or Register  to view this content.
    The range has been set for H5 to H100. You can edit that for as many rows as desired.
    Attached Files Attached Files

  8. #8
    Registered User
    Join Date
    05-03-2017
    Location
    UK
    MS-Off Ver
    2010
    Posts
    12
    Thank you for this

    Quote Originally Posted by Logit View Post
    .
    Using Column H (that has the colors) and running the Macro Recorder .... this is the macro it created :

    Please Login or Register  to view this content.
    The range has been set for H5 to H100. You can edit that for as many rows as desired.

  9. #9
    Forum Expert Logit's Avatar
    Join Date
    12-23-2012
    Location
    North Carolina
    MS-Off Ver
    Excel 2019 Professional Plus - 2007 Enterprise
    Posts
    7,014

    Re: Automatic Sorting after adding a new row entry

    .
    You are welcome.

+ 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. automatic date entry
    By nnguys in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 08-23-2013, 08:42 AM
  2. automatic erasing of field entry and date entry
    By roadkill in forum Excel Programming / VBA / Macros
    Replies: 7
    Last Post: 06-24-2008, 10:20 AM
  3. Automatic data entry
    By ken54321 in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 11-28-2007, 11:36 AM
  4. Automatic data entry
    By paul66 in forum Excel General
    Replies: 2
    Last Post: 11-10-2007, 07:45 PM
  5. Automatic entry in a cell
    By jimmisavage in forum Excel General
    Replies: 2
    Last Post: 06-04-2007, 04:22 AM
  6. [SOLVED] Automatic cell entry
    By deniseh in forum Excel General
    Replies: 4
    Last Post: 06-20-2006, 12:55 PM
  7. Automatic Date Entry
    By JE McGimpsey in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 09-06-2005, 06:05 AM
  8. [SOLVED] Automatic Date Entry
    By Neil in forum Excel Formulas & Functions
    Replies: 0
    Last Post: 09-06-2005, 12:05 AM

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