View Single Post
  #1   Report Post  
Posted to microsoft.public.excel.programming
ina ina is offline
external usenet poster
 
Posts: 120
Default how to get month and year from date

thank you a log but I would like to use datediff between the first date
and and now today but I have a strange result I do not undestand why

Do While datedifferencee 0

currendatemonth = Month(currentdate)
currentdateyear = Year(currentdate)


difference = datediff("m", todaydate, currentdate)

datedifferencee = CInt(difference)


currentdate = DateSerial(Year(currentdate), Month(currentdate) + i, 0)


currendatemonth = currendatemonth + 1

Loop

Ina