+ Reply to Thread
Results 1 to 4 of 4

Saving with Today's date as part of the string

  1. #1
    The Hawk
    Guest

    Saving with Today's date as part of the string

    Hello all: I'm trying to save a a workbook with the current day's date
    (short) automatically as part of the string. I've tried SaveAs and GetSaveAs
    with no success. Here is the code:
    Private Sub btnSave_Click()
    Dim fName As String
    MemberDate = xlDateShort
    ActiveWorkbook.SaveAs Filename:=fName, FileFormat:=xlNormal
    fName = "Member Voting -" & MemberDate

    End Sub

    Any advice will be sincerely appreciated...


  2. #2
    KL
    Guest

    Re: Saving with Today's date as part of the string

    Hi,

    Try this:

    Private Sub btnSave_Click()
    Dim fName As String
    fName="Member Voting -" & Format(Date,"yyyy-mm-dd")
    ActiveWorkbook.SaveAs fName
    End Sub

    Regards,
    KL


    "The Hawk" <[email protected]> wrote in message
    news:[email protected]...
    > Hello all: I'm trying to save a a workbook with the current day's date
    > (short) automatically as part of the string. I've tried SaveAs and
    > GetSaveAs
    > with no success. Here is the code:
    > Private Sub btnSave_Click()
    > Dim fName As String
    > MemberDate = xlDateShort
    > ActiveWorkbook.SaveAs Filename:=fName, FileFormat:=xlNormal
    > fName = "Member Voting -" & MemberDate
    >
    > End Sub
    >
    > Any advice will be sincerely appreciated...
    >




  3. #3
    Doug Glancy
    Guest

    Re: Saving with Today's date as part of the string

    You need to assign the value to fdate before you use it in the SaveAs.

    hth,

    Doug

    "The Hawk" <[email protected]> wrote in message
    news:[email protected]...
    > Hello all: I'm trying to save a a workbook with the current day's date
    > (short) automatically as part of the string. I've tried SaveAs and
    > GetSaveAs
    > with no success. Here is the code:
    > Private Sub btnSave_Click()
    > Dim fName As String
    > MemberDate = xlDateShort
    > ActiveWorkbook.SaveAs Filename:=fName, FileFormat:=xlNormal
    > fName = "Member Voting -" & MemberDate
    >
    > End Sub
    >
    > Any advice will be sincerely appreciated...
    >




  4. #4
    The Hawk
    Guest

    Re: Saving with Today's date as part of the string

    It worked Great! Thanks...

    "KL" wrote:

    > Hi,
    >
    > Try this:
    >
    > Private Sub btnSave_Click()
    > Dim fName As String
    > fName="Member Voting -" & Format(Date,"yyyy-mm-dd")
    > ActiveWorkbook.SaveAs fName
    > End Sub
    >
    > Regards,
    > KL
    >
    >
    > "The Hawk" <[email protected]> wrote in message
    > news:[email protected]...
    > > Hello all: I'm trying to save a a workbook with the current day's date
    > > (short) automatically as part of the string. I've tried SaveAs and
    > > GetSaveAs
    > > with no success. Here is the code:
    > > Private Sub btnSave_Click()
    > > Dim fName As String
    > > MemberDate = xlDateShort
    > > ActiveWorkbook.SaveAs Filename:=fName, FileFormat:=xlNormal
    > > fName = "Member Voting -" & MemberDate
    > >
    > > End Sub
    > >
    > > Any advice will be sincerely appreciated...
    > >

    >
    >
    >


+ 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