Sorting rows in Excel 2013 based on when they were added

1

Is there a way to sort rows in Excel 2013 based on when the rows were added?

NateN

Posted 2015-07-27T17:09:35.850

Reputation: 11

Question was closed 2015-08-05T18:30:59.663

1Excel doesn't have a way to track when cells were added so without a specific column stating when it was added you can't do this. – gtwebb – 2015-07-27T18:03:28.537

http://meta.superuser.com/q/10696/468548 – User15 – 2015-09-07T13:29:12.097

Answers

2

Sure, just assign one of the columns in your data to the date. When you enter values in the row, enter today's date in that column. Once you have completed entering the row data, sort the table by the date column.

Gary's Student

Posted 2015-07-27T17:09:35.850

Reputation: 15 540

0

The most effective solution will depend largely on how your workbook is constructed. I suggest the following:

Designate column A to track the dates and times at which new rows are added. You can then hide column A so nobody sees it (select the entire column and set the width to 0). Next, try the following macro:

Sub InsertRowWithDate()

    Dim CurrentDate As String, CurrentTime As String
        CurrentDate = Format(Date, "MMM DD, YYYY")
        CurrentTime = Format(Time, "HHMM")

'Inserts a new row above the currently selected cell

    Rows(ActiveCell.Row).Insert Shift:=xlDown, CopyOrigin:=xlFormatFromLeftOrAbove

'Inserts the current date and time into Column A of the row just inserted.

    Cells(Application.ActiveCell.Row, "A").Value = CurrentDate & " " & CurrentTime          

End Sub

this will insert a new row above whatever cell you have selected. The current date and time will be placed into your hidden column A.

Assign an easy to remember hot key, or button to this macro for easy access. Now you can simply sort your data by column A.

If you want your macro to automatically sort the data each time you insert a new row, we can make that happen too.

Let me know if this works for you.

Jamiho

Posted 2015-07-27T17:09:35.850

Reputation: 157