Results 1 to 4 of 4

Thread: [RESOLVED] DateSeperator in VBA

  1. #1

    Thread Starter
    Lively Member
    Join Date
    Feb 2007
    Location
    Dublin, Ireland
    Posts
    120

    Resolved [RESOLVED] DateSeperator in VBA

    Hi,
    Does anyone know the VBA equivalent of the "DateSeparator" function in VB6 which differentiates years, months and days of a date?
    Thanks.

  2. #2
    New Member
    Join Date
    Nov 2006
    Posts
    8

    Re: DateSeperator in VBA

    how about:

    sDay = Day(MyDate)
    sMonth = Month(MyDate)
    sYear = Year(MyDate)

  3. #3
    Ex-Super Mod RobDog888's Avatar
    Join Date
    Apr 2001
    Location
    LA, Calif. Raiders #1 AKA:Gangsta Yoda™
    Posts
    60,709

    Re: DateSeperator in VBA

    There is no "DateSeparator" type function in VB 6. Can you clarify what the results are that you are trying to get?

    There are several date/time functions, one of which is DateDiff where you can pass the interval of days/weeks/months/years for calculation of the difference.

    There is Day/Month/Year like weetobix posted.

    There is the Format command for if you need to format the date with just part or in a certain mm/dd/yyyy, dd/mm/yyyy, etc format.

    ...
    ...
    ...
    VB/Office Guru™ (AKA: Gangsta Yoda®)
    I dont answer coding questions via PM. Please post a thread in the appropriate forum.

    Microsoft MVP 2006-2011
    Office Development FAQ (C#, VB.NET, VB 6, VBA)
    Senior Jedi Software Engineer MCP (VB 6 & .NET), BSEE, CET
    If a post has helped you then Please Rate it!
    Reps & Rating PostsVS.NET on Vista Multiple .NET Framework Versions Office Primary Interop AssembliesVB/Office Guru™ Word SpellChecker™.NETVB/Office Guru™ Word SpellChecker™ VB6VB.NET Attributes Ex.Outlook Global Address ListAPI Viewer utility.NET API Viewer Utility
    System: Intel i7 6850K, Geforce GTX1060, Samsung M.2 1 TB & SATA 500 GB, 32 GBs DDR4 3300 Quad Channel RAM, 2 Viewsonic 24" LCDs, Windows 10, Office 2016, VS 2019, VB6 SP6

  4. #4

    Thread Starter
    Lively Member
    Join Date
    Feb 2007
    Location
    Dublin, Ireland
    Posts
    120

    Re: DateSeperator in VBA

    Cheers,
    Thanks for your help.

Posting Permissions

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



Click Here to Expand Forum to Full Width