How can I prioritize data automatically?

S

Sabbjl

I am trying to set up a workbook to automatically move older dated items to
the top of my workbook and possibly shade them.
 
R

ryguy7272

This tiny macro will auto-sort data in Column C, as well as all data in the
same row in Column A and Column B.

Private Sub Worksheet_Change(ByVal Target As Excel.Range)
Dim EndData As Long

If Target.Column <> 3 Then Exit Sub 'Sort is done based on data in
Column C, which is the third column

Application.ScreenUpdating = False

EndData = Cells(Rows.Count, 1).End(xlUp).Row

With Range(Cells(3, 1), Cells(EndData, 3)) 'Sort is done based on data
in Column C, which is the third column
.Sort Key1:=Range("C2"), Order1:=xlDescending, Header:=xlGuess, _
OrderCustom:=1, MatchCase:=False, Orientation:=xlTopToBottom
End With

Application.ScreenUpdating = False
End Sub

HTH,
Ryan--
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top