Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
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.
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11,272
Default 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
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Date Formula for number of days between a date and today BrendaP Excel Discussion (Misc queries) 7 July 2nd 09 07:30 PM
Calculating specific increments of time across days asynmyx Excel Worksheet Functions 2 May 9th 08 06:43 PM
business day date from a specific date based on a number of days Jana Excel Worksheet Functions 2 January 2nd 08 06:21 PM
calculate a date X number of days before/after given date Samantha Excel Worksheet Functions 1 September 4th 07 06:02 AM
Excel Formula to calulate number of days passed from date to date K. Mack Excel Discussion (Misc queries) 8 January 4th 07 11:27 PM


All times are GMT +1. The time now is 07:24 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"