View Single Post
  #1   Report Post  
Posted to microsoft.public.excel.programming
Bob Phillips[_6_] Bob Phillips[_6_] is offline
external usenet poster
 
Posts: 11,272
Default MonthName to Integer from Current to Previous Year

Do something like

dt = Date
m = Month(dt)
m = m - 4
If m <= 0 Then m = m + 12


--
HTH

Bob Phillips

(remove nothere from email address if mailing direct)

"nerbe" wrote in message
ups.com...
Sorry. I should have clarified...

The way I am currently calculating this is essentially 4-7 = -3. That
is, (April 2006) - (7 months) = October 2005

October is the 10th month of the year, but in doing the math the way I
am currently doing it, I get a negative number -- a number that does
not correspond to a month 1 thru 12.