ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Discussion (Misc queries) (https://www.excelbanter.com/excel-discussion-misc-queries/)
-   -   Auto-arrange (https://www.excelbanter.com/excel-discussion-misc-queries/370755-auto-arrange.html)

Mattaphylactic

Auto-arrange
 
1 Attachment(s)
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.

Don Guillett[_2_]

Auto-arrange
 
Right click sheet tabview codeinsert 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



On Feb 3, 4:54*pm, Mattaphylactic <Mattaphylactic.
wrote:
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|
+-------------------------------------------------------------------+

--
Mattaphylactic



No Name

Auto-arrange
 
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|
+-------------------------------------------------------------------+



--
Mattaphylactic



All times are GMT +1. The time now is 12:12 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
ExcelBanter.com