View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
Harald Staff Harald Staff is offline
external usenet poster
 
Posts: 1,327
Default Using Dates in VBA functions

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

"christobal " skrev i melding
...
For entering credit payment dates
On a userform I have a control which displays "Date" with a calendar
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 of
textbox "total amount" divided by textbox "number of payments"
according to the 2nd of the consecutive month chosen for the "number of
payments" as number of rows in listbox.
If the day value is between 16th and Last day of month then the payment
date will be the 8th of the consecutive month.
Is such a date calculation possible and if so then how?


---
Message posted from http://www.ExcelForum.com/