#1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27,285
Default 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
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
How to update a date in a Master List using daily list Gloria Lewis Excel Discussion (Misc queries) 0 February 28th 08 09:17 PM
Match Date/Time to Date list Sandy Excel Worksheet Functions 4 October 16th 07 07:09 PM
How can I match a calculated date to closest date from a list? David P Excel Worksheet Functions 2 January 22nd 07 12:05 PM
finding a date/time in a list that is closest to an existing date/ Jamie Excel Discussion (Misc queries) 1 May 27th 06 08:54 PM
Auto filtering vs Date List Create List torajudo Excel Worksheet Functions 2 January 29th 06 10:30 AM


All times are GMT +1. The time now is 04:09 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"