Thread: Now()
View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
Ron de Bruin Ron de Bruin is offline
external usenet poster
 
Posts: 11,123
Default Now()

Hi

You can use the format function

Range("i3").Value = "YTD " & Format(Month(Date - 45), "mmm")


--
Regards Ron de Bruin
http://www.rondebruin.nl


"tjh" wrote in message ...

Hello,

I am trying to use the below VBA code to show the words "YTD May" or the
month 45 days ago.

Something is not correct in my code, because after running it displays "YTD 5"

Range("i3").Value = "YTD " & Month(Now() - 45)

How can I correct the formatting of the Month in this code?

Thank You