Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
Date increments by X number of days
I don't really know much about VBA, but I'm learning. Trying to teach myself.
Thank you to all who have posted questions and answers enabling me to advance my skills. My questions are about dates. If I create a variable like this: 'this could be wrong, like I said I don't know much dim LastCall as Date dim NextCall as Date Now, I want to read in a date in MM/D(D)/YYYY format to LastCall and make NextCall equal to LastCall + 5 days. How do I do this without writing a huge if then statement? (if the month = this or this for 30 days then if the current date is 26 or greater .....else if month = this or this for 31 days then if the current date is 27 or greater...change month...) Also, how do I access the system date? I want to then compare the NextCall date to system date (current date) and then I'll be creating a task in Outlook if current date is = NextCall. I suppose it would be easier to just compare the system date to LastCall and figure out if it is 5 days or more, so if you can suggest how to do that, it would be appreciated as well. |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
Date increments by X number of days
Nextcall = Lastcall + 5
sysDate = Date If Date = NextCall Then ... or If Date = LastCall + 5 Then ... -- HTH RP (remove nothere from the email address if mailing direct) "sweens319" wrote in message ... I don't really know much about VBA, but I'm learning. Trying to teach myself. Thank you to all who have posted questions and answers enabling me to advance my skills. My questions are about dates. If I create a variable like this: 'this could be wrong, like I said I don't know much dim LastCall as Date dim NextCall as Date Now, I want to read in a date in MM/D(D)/YYYY format to LastCall and make NextCall equal to LastCall + 5 days. How do I do this without writing a huge if then statement? (if the month = this or this for 30 days then if the current date is 26 or greater ......else if month = this or this for 31 days then if the current date is 27 or greater...change month...) Also, how do I access the system date? I want to then compare the NextCall date to system date (current date) and then I'll be creating a task in Outlook if current date is = NextCall. I suppose it would be easier to just compare the system date to LastCall and figure out if it is 5 days or more, so if you can suggest how to do that, it would be appreciated as well. |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Date Formula for number of days between a date and today | Excel Discussion (Misc queries) | |||
Calculating specific increments of time across days | Excel Worksheet Functions | |||
business day date from a specific date based on a number of days | Excel Worksheet Functions | |||
calculate a date X number of days before/after given date | Excel Worksheet Functions | |||
Excel Formula to calulate number of days passed from date to date | Excel Discussion (Misc queries) |