i have written code gives me sequence of dates in form of "mmm yy" format. e.g. jan 15 .
for = 1 20 msgbox format(dateadd("m", i, "01/01/2005"), "mmm") & " " & right(year(date), 2) next
the problem having when goes on increasing year not change. example if i 12 should jan 06 still gives me jan 05 again. want generate sequence jan 05 today i.e. sep 15 please advice.
create variable , add date.
private sub commandbutton1_click() dim ddate date dim integer ddate = "01/01/2005" = 1 20 msgbox format(ddate, "mmm") & " " & right(year(ddate), 2) ddate = dateadd("m", 1, ddate) next end sub
Comments
Post a Comment