Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 6
Default Working with dates in VBA

I have a workbook that I created that has a column containing dates. These
dates are due dates. I would like to write a procedure to execute on workbook
open that will check these dates. I have written the code that will iterate
through each row in the column in each worksheet. Now I am trying to figure
out how to write this sub to do the following but I am not sure of the syntax.

If dueDate <= 30 days from now Then
send email
End If

I am just not familiar with working with dates in Excel. Does anyone have
any suggestions?
Thanks
End If

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2,510
Default Working with dates in VBA

Hi Samual,

Just need to confirm exactly what is required.

If dueDate <= 30 days from now

Dates that are less than now like last month would be included in that kind
of statement. Is that what you want? In VBA Date is today's date so if that
is what you want then:-

If DueDate <= Date + 30 Then

--
Regards,

OssieMac


"Samuel Looney" wrote:

I have a workbook that I created that has a column containing dates. These
dates are due dates. I would like to write a procedure to execute on workbook
open that will check these dates. I have written the code that will iterate
through each row in the column in each worksheet. Now I am trying to figure
out how to write this sub to do the following but I am not sure of the syntax.

If dueDate <= 30 days from now Then
send email
End If

I am just not familiar with working with dates in Excel. Does anyone have
any suggestions?
Thanks
End If

  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 31
Default Working with dates in VBA

Samuel;

If you have no experience with working with dates in VBA/Excel, I recommend
you study the subject.
I don't know were you live, but VBA is English/US and your regional settings
in Excel might be different.

I live in the Netherlands and we write dates in this order: DD/MM/YYYY
9/11, the most globally known date at the moment, is written down here as
11/09/2001.

Mind you, there are still people here who interpret this day as the ninth of
November, because of the 9/11 figure !!!

I can recommend David McRitchey's site about dates and time in Excel.
Good luck.

--
Regards;
Mark Rosenkrantz
--
Spreadsheet Solutions
Uithoorn
Netherlands (Those who live some 18 feet below sea level)
--
E:
W:
www.spreadsheetsolutions.nl
--
"Samuel Looney" wrote in message
...
I have a workbook that I created that has a column containing dates. These
dates are due dates. I would like to write a procedure to execute on
workbook
open that will check these dates. I have written the code that will
iterate
through each row in the column in each worksheet. Now I am trying to
figure
out how to write this sub to do the following but I am not sure of the
syntax.

If dueDate <= 30 days from now Then
send email
End If

I am just not familiar with working with dates in Excel. Does anyone have
any suggestions?
Thanks
End If


  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11,123
Default Working with dates in VBA

Check out example 2 here
http://www.rondebruin.nl/mail/folder3/message.htm

--

Regards Ron de Bruin
http://www.rondebruin.nl/tips.htm


"Samuel Looney" wrote in message ...
I have a workbook that I created that has a column containing dates. These
dates are due dates. I would like to write a procedure to execute on workbook
open that will check these dates. I have written the code that will iterate
through each row in the column in each worksheet. Now I am trying to figure
out how to write this sub to do the following but I am not sure of the syntax.

If dueDate <= 30 days from now Then
send email
End If

I am just not familiar with working with dates in Excel. Does anyone have
any suggestions?
Thanks
End If


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
Working with dates Lestergit Excel Worksheet Functions 0 May 20th 10 05:22 PM
Working with dates andrew Excel Discussion (Misc queries) 5 August 21st 08 04:20 AM
Working with Dates Byron720 Excel Worksheet Functions 3 December 28th 06 12:02 AM
Working with dates Al Excel Worksheet Functions 3 April 21st 06 05:49 PM
Working with Dates Tywardreath Excel Programming 2 July 27th 05 02:43 AM


All times are GMT +1. The time now is 01:11 AM.

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"