Consulting

Results 1 to 5 of 5

Thread: Date Format Error

  1. #1
    VBAX Regular
    Joined
    Jan 2007
    Posts
    7
    Location

    Date Format Error

    Good Morning!

    Can someone help with this? I am receiving a Run-Time Error 13 - Type Mismatch.

    thisdate = Int(Now)
    revdate = Format(thisdate, "m/d/yy")
    It doesn't like the format. I originally was using "dd" which worked fine but now need the full date.

    Thank you,
    Donna

  2. #2
    VBAX Master
    Joined
    Jul 2006
    Location
    Belgium
    Posts
    1,289
    Location
    Perhaps :
    Dim revdate As Date
    revdate = Format(Now, "m/d/yy")
    Charlize
    Last edited by Aussiebear; 04-15-2023 at 11:35 AM. Reason: Adjusted the code tags

  3. #3
    VBAX Regular
    Joined
    Jan 2007
    Posts
    7
    Location

    Thank you

    Duh...had it as double. Thank you!

  4. #4
    Distinguished Lord of VBAX VBAX Grand Master Bob Phillips's Avatar
    Joined
    Apr 2005
    Posts
    25,453
    Location
    Quote Originally Posted by Charlize
    Perhaps :
    [vba]Dim revdate As Date
    revdate = Format(Now, "m/d/yy")[/vba] Charlize
    Surely, revdate is a string here, and why use Now

    [vba]

    Dim revdate As String

    revdate = Format(Date, "m/d/yy")
    [/vba]

  5. #5
    VBAX Master
    Joined
    Jul 2006
    Location
    Belgium
    Posts
    1,289
    Location
    Quote Originally Posted by xld
    Surely, revdate is a string here, and why use Now

    Dim revdate As String
    revdate = Format(Date, "m/d/yy")
    Surely ? I don't know. Can't read the mind. Don't know what the poster wanted to do.
    Why Now. The poster used it so I just took it over without further thinking about it.

    Charlize
    Last edited by Aussiebear; 04-15-2023 at 11:37 AM. Reason: Adjusted the code tags

Posting Permissions

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