Using Dates in VBA functions

C

christobal

For entering credit payment dates
On a userform I have a control which displays "Date" with a calenda
control to change the value.
If the day value is between the 1st and 15th inclusive, of the month
chosen, then I require that a listbox is populated with the result o
textbox "total amount" divided by textbox "number of payments
according to the 2nd of the consecutive month chosen for the "number o
payments" as number of rows in listbox.
If the day value is between 16th and Last day of month then the paymen
date will be the 8th of the consecutive month.
Is such a date calculation possible and if so then how
 
H

Harald Staff

Sub test()
Dim d As Date
d = Now 'or whatever in your code
If Day(d) > 16 Then
MsgBox " The owls are not what they seem to be"
Else
MsgBox "Doh!!"
End If
End Sub


HTH. Best wishes Harald
 
C

christobal

The date issue is clear now but how can I pass the required dates afte
calculating the payment day value to a listbox showing the consecutiv
payments according to the number of payments

Date = 1/1/2004
Total = 450
Payments =3
i.e.
2/2/2004 150$
2/3/2004 150$
2/4/2004 150
 
Top