+ Reply to Thread
Results 1 to 3 of 3

Thread: Date in VBA

  1. #1
    witek
    Guest

    Date in VBA

    Hi guys.

    I have three variables, day, month and year.

    How to create a valid date from them.

    CDate needs expression, but it depends on regional settings, so
    CDate ("5/6/2006") will return May 6th, or June 5th depends on settings.

    I need something more universal.
    Does it exist?

  2. #2
    Jim Thomlinson
    Guest

    RE: Date in VBA

    Try DateSerial something like this...

    MsgBox DateSerial(2005, 5, 6)
    --
    HTH...

    Jim Thomlinson


    "witek" wrote:

    > Hi guys.
    >
    > I have three variables, day, month and year.
    >
    > How to create a valid date from them.
    >
    > CDate needs expression, but it depends on regional settings, so
    > CDate ("5/6/2006") will return May 6th, or June 5th depends on settings.
    >
    > I need something more universal.
    > Does it exist?
    >


  3. #3
    witek
    Guest

    Re: Date in VBA

    Jim Thomlinson wrote:
    > Try DateSerial something like this...
    >
    > MsgBox DateSerial(2005, 5, 6)


    Yes, Thanks.


+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

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

Search Engine Friendly URLs by vBSEO 3.2.0