Results 1 to 3 of 3
  1. #1
    2 Star Lounger
    Join Date
    Mar 2004
    Posts
    129
    Thanks
    0
    Thanked 0 Times in 0 Posts

    MonthName (VBA/Excel/97)

    Why might this not work?

    sub CurrentDate()
    dim DetMonth as double
    dim strMonth as string

    DetMonth = (Month(Now()))
    strMonth = MonthName(DetMonth)
    ...

    I keep getting a "type mismatch" error.

  2. #2
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

    Re: MonthName (VBA/Excel/97)

    Month returns an Integer, not a Double, but that is not the problem. Your code works OK on my system (it sets strMonth to 'July')

    Do you happen to have a custom function named Month or Now or MonthName?

  3. #3
    2 Star Lounger
    Join Date
    Mar 2004
    Posts
    129
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: MonthName (VBA/Excel/97)

    Yes! Thanks.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •