Results 1 to 6 of 6
  1. #1
    New Lounger
    Join Date
    Feb 2002
    Location
    Los Angeles, CA
    Posts
    2
    Thanks
    0
    Thanked 0 Times in 0 Posts

    VBA equiv to 'Serialdate?' (VB/VBA)

    Hi,
    I'm trying to create a simple macro in Word2000 to generate a PO number. Nothing fancy, and will only need 1 or 2 per day. There used to be a "serialdate" command, but think it's no longer. Can anyone suggest a VB/VBA command?

    Also need a good (up to date) reference of VBA commands. Which of the "Woody Books" should I buy? <img src=/S/smile.gif border=0 alt=smile width=15 height=15>
    Thanks!
    LenG

  2. #2
    Plutonium Lounger
    Join Date
    Dec 2000
    Location
    Sacramento, California, USA
    Posts
    16,775
    Thanks
    0
    Thanked 1 Time in 1 Post

    Re: VBA equiv to 'Serialdate?' (VB/VBA)

    Are you thinking of DateSerial?
    Charlotte

  3. #3
    New Lounger
    Join Date
    Feb 2002
    Location
    Los Angeles, CA
    Posts
    2
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: VBA equiv to 'Serialdate?' (VB/VBA)

    Maybe I am. My (very old) book is showing Date$([SerialDate]). Does DateSerial work?

  4. #4
    Plutonium Lounger
    Join Date
    Dec 2000
    Location
    Sacramento, California, USA
    Posts
    16,775
    Thanks
    0
    Thanked 1 Time in 1 Post

    Re: VBA equiv to 'Serialdate?' (VB/VBA)

    I don't know. What does SerialDate represent? It looks to me like a field name because of the brackets around it.. I suspect it represents a date in serial format rather than a function. What exactly are you trying to do?
    Charlotte

  5. #5
    Silver Lounger
    Join Date
    Mar 2001
    Location
    Springfield, Ohio, USA
    Posts
    2,136
    Thanks
    0
    Thanked 1 Time in 1 Post

    Re: VBA equiv to 'Serialdate?' (VB/VBA)

    Use the ObjectBrowser for DateTime to see all of this stuff, then use help to see what a particular method does. Actually, the format function probably does whatever you want. Put these two line in a macro and try them out:<pre>[A2] = "P" & Format(Now, "yymmdd") & Int(100 * (Hour(Now) + Minute(Now) / 60) / 24)
    [A3] = Format(Now, "0.00")</pre>

    <font face="Comic Sans MS">Sam Barrett, CACI </font face=comic>
    <small>And the things that you have heard... commit these to faithful men who will be able to teach others also. 2 Timothy 2:2</small>

  6. #6
    Gold Lounger
    Join Date
    Dec 2000
    Location
    New Hampshire, USA
    Posts
    3,386
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: VBA equiv to 'Serialdate?' (VB/VBA)

    Yes, there still is a DateSerial in VBA.
    Use the Object Browser to get details.

Posting Permissions

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