+ Reply to Thread
Results 1 to 4 of 4

Date Filename Save as Dialog Macro Thingy!!!!!!

  1. #1
    Registered User
    Join Date
    03-04-2006
    Posts
    25

    Question Date Filename Save as Dialog Macro Thingy!!!!!!

    Hi there excel peeps, Hope you all are well.

    I've got a bit of a problem, no one I know can help, and I can't find the A team!!!!

    PLEASE.

    Can anyone give me the Visual Basic Code to open up a 'save as' dialog box, with the filename as 'dd/mm/yy_sportsreturn', (dd/mm/yy being the save date or a cell reference to a date), but give the user the ability to save the file where they want to?

    I've had a few goes, but i'm new to VBA and I can get the file to save as a date formatted filename but I can't just get the box to open with the correct filename, filetype(excel), and let the user put it where he wants. It's getting a bit frustrating.

    If i'm asking too much from excel/VBA can someone just give me a nudge, i'll shut up and go do an ECDL course or something

    Many Thanks in advance

    Gaz

  2. #2
    Registered User
    Join Date
    03-04-2006
    Posts
    25
    PS

    ive had a look round the forums and can't find an answer!!!!!


  3. #3
    Ed
    Guest

    Re: Date Filename Save as Dialog Macro Thingy!!!!!!

    (1) Open Excel, press Alt+F11, press F1, and look for the Help file for
    BuiltInDialogs. GO from there and explore in Help anything that's
    unfamiliar to you.

    (2) A better search engine is Google Groups; use a few key words in groups
    *excel*.

    HTH
    Ed

    "Cobbcouk" <[email protected]> wrote in
    message news:[email protected]...
    >
    > PS
    >
    > ive had a look round the forums and can't find an answer!!!!!
    >
    >
    >
    >
    > --
    > Cobbcouk
    > ------------------------------------------------------------------------
    > Cobbcouk's Profile:
    > http://www.excelforum.com/member.php...o&userid=32143
    > View this thread: http://www.excelforum.com/showthread...hreadid=528247
    >




  4. #4
    NickHK
    Guest

    Re: Date Filename Save as Dialog Macro Thingy!!!!!!

    Cobbcouk,
    You need to look at "GetSaveAsFilename".

    Dim FileName as string
    Dim RetVal As Variant

    FileName=Format(Now(), "dd/mm/yy") & "_sportsreturn.xls"
    str = Application.GetSaveAsFilename(FileName)
    'make sure the user did not change the filename
    If str<>FileName Then
    Msgbox "No, file must be called " & FileName
    Exit sub
    Else
    'OK to save
    Thisworkbook.SaveAs FileName
    End If

    You need to handle the case when the clicks also. Hint: RetVal=False

    NickHK

    "Cobbcouk" <[email protected]> wrote in
    message news:[email protected]...
    >
    > Hi there excel peeps, Hope you all are well.
    >
    > I've got a bit of a problem, no one I know can help, and I can't find
    > the A team!!!!
    >
    > PLEASE.
    >
    > Can anyone give me the Visual Basic Code to open up a 'save as' dialog
    > box, with the filename as 'dd/mm/yy_sportsreturn', (dd/mm/yy being the
    > save date or a cell reference to a date), but give the user the ability
    > to save the file where they want to?
    >
    > I've had a few goes, but i'm new to VBA and I can get the file to save
    > as a date formatted filename but I can't just get the box to open with
    > the correct filename, filetype(excel), and let the user put it where he
    > wants. It's getting a bit frustrating.
    >
    > If i'm asking too much from excel/VBA can someone just give me a nudge,
    > i'll shut up and go do an ECDL course or something
    >
    > Many Thanks in advance
    >
    > Gaz
    >
    >
    > --
    > Cobbcouk
    > ------------------------------------------------------------------------
    > Cobbcouk's Profile:

    http://www.excelforum.com/member.php...o&userid=32143
    > View this thread: http://www.excelforum.com/showthread...hreadid=528247
    >




+ 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