View Single Post
  #1   Report Post  
Posted to microsoft.public.excel.programming
CG Rosén CG Rosén is offline
external usenet poster
 
Posts: 74
Default DateAdd question

Good day Group,

Have some problem to understand the DateAdd function.
Seems that if the start date is a month with a last date of 28 and 30
the DateAdd function does not add a month in the way that the following
month will be shown with its last date. It works if the start date is a
month
that with a last date of 31.
The problem can be checked by following code.
Is this the way it is supposed to be or am I doing this the wrong way?

str = "2006-02-28"

For i = 1 To 5

d = DateAdd("m", i, str)

MsgBox d

Next i

Brgds

CG Rosen