If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below. |
|
|
Thread Tools | Display Modes |
#1
|
|||
|
|||
How can I insert a earlier date and sort it chronologicaly?
I am using a template form and in my date column (B, 10-199) I wish to enter
an earlier date into the last row and have it sort to its' chronological place in the column, i.e. say enter a Feb date after a March date and have it in its logical spot in my date column. |
#2
|
|||
|
|||
How can I insert a earlier date and sort it chronologicaly?
DataSort
But, I think you want it to be "automatic" as you enter a new date. I do not recommend this. In the case of an error, very difficult to find the error after the sort. If you want to autosort there is VBA code available. See this google search result for Sandy Mann code to autosort. http://tinyurl.com/39p64f Gord Dibben MS Excel MVP On Mon, 9 Mar 2009 10:08:01 -0700, larry wrote: I am using a template form and in my date column (B, 10-199) I wish to enter an earlier date into the last row and have it sort to its' chronological place in the column, i.e. say enter a Feb date after a March date and have it in its logical spot in my date column. |
#3
|
|||
|
|||
How can I insert a earlier date and sort it chronologicaly?
Hi,
Here is some sample code: Private Sub Worksheet_Change(ByVal Target As Range) Dim isect As Range Set isect = Application.Intersect(Target, Range("B10:B100")) If Not isect Is Nothing Then 'Your code here End If End Sub You should record the Data, Sort command and then stick the results into the "Your code here" location. For example you might get something like Range("B10:B100").Sort Key1:=Range("B10"), Order1:=xlAscending, Header:= _ xlGuess, OrderCustom:=1, MatchCase:=False, Orientation:=xlTopToBottom, _ DataOption1:=xlSortTextAsNumbers 1. To add this code to your file, press Alt+F11, 2. In the VBAProject window, top left side, find your sheet name under your file name and double click it. 3. Paste in or type the code above. -- If this helps, please click the Yes button. Cheers, Shane Devenshire "larry" wrote: I am using a template form and in my date column (B, 10-199) I wish to enter an earlier date into the last row and have it sort to its' chronological place in the column, i.e. say enter a Feb date after a March date and have it in its logical spot in my date column. |
Thread Tools | |
Display Modes | |
|
|