Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.newusers
|
|||
|
|||
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
Posted to microsoft.public.excel.newusers
|
|||
|
|||
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. |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
how do I subtract time from a date to get an earlier date? | Excel Discussion (Misc queries) | |||
Deriving an earlier date based on a later date | Excel Worksheet Functions | |||
How can I insert a date with an icon (calendar) insert | Excel Discussion (Misc queries) | |||
How do I format an Excel date earlier than 1900? | Excel Worksheet Functions | |||
How do I replace dates earlier than certain date? | Excel Discussion (Misc queries) |