Results 1 to 2 of 2
  1. #1
    Bronze Lounger
    Join Date
    Jan 2001
    Location
    Melbourne, Australia
    Posts
    1,294
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Code for Get todays date & previous & next day

    VBA - Excel

    I remember someone posting issue re code for obtaining todays date, then working out next day or previous day.

    I did a seach on forum but search didnt return the result I was looking for.
    It may have been posted on previous forum before format changed.(& which you cant search old forum).
    Does anyone have this thread or bit of code?

    I would much appeciate it
    Thanks Diana

  2. #2
    Uranium Lounger
    Join Date
    Jan 2001
    Location
    South Carolina, USA
    Posts
    7,295
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Code for Get todays date & previous & next day

    The following VBA code will give you what you want:

    <pre>Dim dtToday As Date, dtYesterday As Date, dtTomorrow As Date
    dtToday = Date
    dtYesterday = Date - 1
    dtTomorrow = Date + 1
    </pre>

    Legare Coleman

Posting Permissions

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