View Single Post
  #1   Report Post  
Posted to microsoft.public.excel.programming
sweens319 sweens319 is offline
external usenet poster
 
Posts: 18
Default 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.