View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
OssieMac OssieMac is offline
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