Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
date list
Sub fill1()
Dim dt1 As Date Dim dt2 As Date dt1 = DateValue("08/02/2003") dt2 = DateValue("08/13/2003") Range("A1").Value = dt1 Range("A1").NumberFormat = "dd/mm/yy" i = 0 Do While dt1 + i < dt2 i = i + 1 Range("A1").Offset(i, 0).Value = dt1 + i Range("A1").Offset(i, 0).NumberFormat = "dd/mm/yy" Loop End Sub you could also do it in one step using fill. Sub FillDates() Dim dt1 As Date Dim dt2 As Date dt1 = DateValue("08/02/2003") dt2 = DateValue("08/13/2003") Selection(1).Select ActiveCell.Value = dt1 ActiveCell.DataSeries Rowcol:=xlColumns, _ Type:=xlChronological, _ Date:=xlDay, _ Step:=1, _ Stop:=dt2, _ Trend:=False End Sub -- Regards, Tom Ogilvy libby q:-) wrote in message ... Hi all Given a start date eg 02/08/03 and an end date eg 13/08/03 is there any way of getting excel to list the dates inbetween? Many thanks in advance. |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
How to update a date in a Master List using daily list | Excel Discussion (Misc queries) | |||
Match Date/Time to Date list | Excel Worksheet Functions | |||
How can I match a calculated date to closest date from a list? | Excel Worksheet Functions | |||
finding a date/time in a list that is closest to an existing date/ | Excel Discussion (Misc queries) | |||
Auto filtering vs Date List Create List | Excel Worksheet Functions |