+ Reply to Thread
Results 1 to 3 of 3

VBA to find next Monday

  1. #1
    Byron
    Guest

    VBA to find next Monday

    What is the best way to find the date for next monday, and return the value
    in as part of the file name when saving?



  2. #2
    Forum Moderator Leith Ross's Avatar
    Join Date
    01-15-2005
    Location
    San Francisco, Ca
    MS-Off Ver
    2000, 2003, & 2010
    Posts
    23,258
    Hello Byron,

    Here is a VBA macro to Return the next Monday from today.

    Please Login or Register  to view this content.
    Sincerely,
    Leith Ross

  3. #3
    Steve Yandl
    Guest

    Re: VBA to find next Monday

    I'm not sure just how you wanted to incorporate the date into the file name
    for the saved workbook but something like this might get you close.

    Sub NameAsNextMon()
    Dim K As Integer
    Dim dteMon As Date
    Dim tempName As Variant

    K = Weekday(Now)
    dteMon = Now() + (9 - K)
    tempName = Year(dteMon) & "-" & Month(dteMon) & "-" & Day(dteMon) & ".xls"
    Do
    fName = Application.GetSaveAsFilename(tempName)
    Loop Until fName <> False
    ActiveWorkbook.SaveAs Filename:=fName
    End Sub


    Steve Yandl


    "Byron" <[email protected]> wrote in message
    news:[email protected]...
    > What is the best way to find the date for next monday, and return the
    > value
    > in as part of the file name when saving?
    >
    >




+ 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.6.0 RC 1