This might do what you want - It's not sophisticated, but
might do the job:
Let's say you have two columns of data that you want
sorted every time a date is updated:
(colA) (col B)
Last loggedin User
06/23/1995 Wallace
06/15/1999 bigbubba
04/27/2001 Sallhy
05/04/2005 Bobb
06/15/2005 frank
01/08/2010 miranda
First, select column A data (dates only) and name
as "DRange"; then select these cells AND the user
names (names only) from Col B and name that
combined set of cells "SrtRange".
Insert the following code in your workbook (select
the tab name at the bottom (ie "Sheet1") by right-
clicking, then view code and paste.
----------------------------
Public sFlag As Boolean
Sub Worksheet_SelectionChange(ByVal Target As Range)
Dim r As Range
Dim s As Range
Set r = Range("DRange")
Set s = Range("SrtRange")
If InRange(Target, r) Then
SortEm s
sFlag = True
Else
If sFlag Then
SortEm s
sFlag = False
End If
End If
End Sub
Function InRange(Target As Range, r As Range)
Dim c As Variant
For Each c In r
If Target.Address = c.Address Then
InRange = True
Exit Function
End If
Next c
End Function
Sub SortEm(s As Range)
s.Sort Key1:=s.Cells(1, 1)
End Sub
------------------------------------
Each time you change dates, both columns will be sorted.
(actually it sorts even when you click on any date
in range "DRange", but I can't get around that.)
good luck,
jr
-----Original Message-----
I HAVE A COLUMN OF DATES AND I NEED TO SORT BY THE MOST
CURRENT DATE AS IT IS UPDATED, WHAT IS THAT FORMULA?