View Single Post
  #4   Report Post  
malik641
 
Posts: n/a
Default another interesting thing...


For come odd reason I can't figure out the sort part, but I got this far
for ya.

Place this VB code in the worksheet that gets its input from the
Database and name the sheet with the filtering "Filter"


Code:
--------------------
Option Explicit

Private Sub Worksheet_Change(ByVal Target As Excel.Range)
Sheets("Filter").Range("A:A").Clear

Dim cell As Variant
Dim Oldval As Variant
Dim NewVal As Variant
Dim i As Long

i = 1
NewVal = vbNullString

For Each cell In ActiveSheet.Range("A:A")
If cell = vbNullString Then Exit For
Oldval = cell.Value
If NewVal < Oldval Then
NewVal = Oldval
Sheets("Filter").Cells(i, 1).Value = NewVal
i = i + 1
End If
Next cell

End Sub
--------------------


--
malik641


------------------------------------------------------------------------
malik641's Profile: http://www.excelforum.com/member.php...o&userid=24190
View this thread: http://www.excelforum.com/showthread...hreadid=479914