View Single Post
  #4   Report Post  
Posted to microsoft.public.excel.programming
Michael Michael is offline
external usenet poster
 
Posts: 791
Default Now Function Question

Try this:
Sub Dateparttest()
Today = Now
Range("B1").Value = Today
Range("B1").NumberFormat = "mmmm"

End Sub







"Nausett" wrote:

I'm trying to use the Now function in VBA. I continue to get a compile
error: Expected function or variable. The error highlights on the word, Now.
The formula below is an example of the code.

Sub Dateparttest()
Dim today
today = Month(Now)
Range("b1").Value = today

End Sub