Results 1 to 2 of 2
  1. #1
    Join Date
    Oct 2005

    Question Unanswered: EndOfLastMonth Function

    I know this might sound straight forward, but i am very new to Visual Basic! I am creating a macro that will change a date in excel to the date of the last day of last month... what is that code for this? Bit embarrased at how simple it sounds lol

  2. #2
    Join Date
    Aug 2005
    Try using DateSerial() function.. :

    DateSerial(year, month, day)

    '************************************************* ****
    For example:

    Dim LastDayOfLastMonth as Date

    LastDayOfLastMonth = DateSerial("2005", "10", 1 - 1)

    'This return the last day of las month, means 30 september 2005
    'The (1-1) return a date that is the day before the first day of october

    '************************************************* ****

Posting Permissions

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