Auto-arrange

M

Mattaphylactic

Hello all, I am quite new to spreadsheets and was wondering if anybod
could help me with this problem. I have attached an image of what I'
working on. Ideally, when I enter new data, the rows shoul
automatically arrange themselves oldest to newest by the date in colum
G. As far as I know, this has to be done with code? Could someone poin
me in the right direction as I have no experience with this.

Thanks again

+-------------------------------------------------------------------
|Filename: excelhelp3.jpg
|Download: http://www.excelbanter.com/attachment.php?attachmentid=288
+-------------------------------------------------------------------
 
D

Don Guillett

Right click sheet tab>view code>insert this. Now when you add a date
at the BOTTOM of col G, Col G will sort. If you want the other way,
change xlAscending to xlDEScending

Private Sub Worksheet_Change(ByVal Target As Range)
If Target.Count > 1 Or Target.Column <> 7 Then Exit Sub
Range("g1:G" & Target.Row).Sort _
Key1:=Range("G1"), Order1:=xlAscending, Header:=xlGuess, _
OrderCustom:=1, Orientation:=xlTopToBottom
End Sub
 
G

Guest

Hi,
a way to learn is to record all your actions as you do into a macro.
One done you can filterout/delete all garbage lines and testing if all
still applies.

choose range / and apply sort



"Mattaphylactic" schreef in bericht


Hello all, I am quite new to spreadsheets and was wondering if anybody
could help me with this problem. I have attached an image of what I'm
working on. Ideally, when I enter new data, the rows should
automatically arrange themselves oldest to newest by the date in column
G. As far as I know, this has to be done with code? Could someone point
me in the right direction as I have no experience with this.

Thanks again.


+-------------------------------------------------------------------+
|Filename: excelhelp3.jpg |
|Download: http://www.excelbanter.com/attachment.php?attachmentid=288|
+-------------------------------------------------------------------+
 

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