PDA

View Full Version : Solved: Convert week N to specific dates (mon to sun)



sebas1102
05-14-2006, 09:39 PM
Hi,
Is it possible to convert a specific week no to the specific dates from Monday to Sunday? :banghead:
I want to have a prompt msgbox which prompts user how many weeks from the system date and it will generate the specific dates out.
Let's say: msgbox(" forecast of how many weeks in advance?")
then user type 3 weeks from today's date.
Then it generates dates of mon to sun 3 weeks from today's date.
I need it so that i could extract the different production numbers for that particular week and collate into a final forecast.
Oh yah, is it possible to add days to a date to give the final dat as well?
i tried:

dim M as date
dim n as date
sub date from days()
M = 15/5/2006
n = 0
do until n = 365
combobox.additem.M+n.value
n = n+1
loop
end loop
end sub

but it apparrantly hanged my system:think:

hope someone can help thanks!
newbie VBA:help

Bob Phillips
05-15-2006, 02:44 AM
Sub DateFromDays()
Dim M As Date
Dim i As Long
M = InputBox("Input date")
If IsDate(M) Then
For i = Date To M
ComboBox1.AddItem Format(i, "ddd dd mmm yyyy")
Next i
End If
End Sub