+ Reply to Thread
Results 1 to 10 of 10

Create Input Box / Save File As

Hybrid View

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

    Re: Create Input Box / Save File As

    Hello Andy,

    I will work on that in the morning. I'm heading off to bed now. Thanks for the input.
    Sincerely,
    Leith Ross

    Remember To Do the Following....

    1. Use code tags. Place [CODE] before the first line of code and [/CODE] after the last line of code.
    2. Thank those who have helped you by clicking the Star below the post.
    3. Please mark your post [SOLVED] if it has been answered satisfactorily.


    Old Scottish Proverb...
    Luathaid gu deanamh maille! (Rushing causes delays!)

  2. #2
    Registered User
    Join Date
    12-17-2009
    Location
    Edinburgh
    MS-Off Ver
    Excel 2003
    Posts
    11

    Re: Create Input Box / Save File As

    That would be great thanks

  3. #3
    Registered User
    Join Date
    12-17-2009
    Location
    Edinburgh
    MS-Off Ver
    Excel 2003
    Posts
    11

    Re: Create Input Box / Save File As

    Hi there. Apologies for thread bump but back at work and still struggling with same problem!

    I am looking for some macro code to create an Input box in excel which will prompt the user to enter a specific date (not todays date so NOW function is not appropriate). This will in turn cause the file to be saved in a specific folder with the date becoming the name of the saved file.

    Any suggestions would be greatly appreciated

    Cheers

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

    Re: Create Input Box / Save File As

    Hello Andy,

    Bliadhna Mhath Ùr!

    Glad you bumped the post. This macro should be closer to what you want. This will save a copy of the workbook the macro is in to the directory you specify and using a name you provide containing the date the user entered. The parameters for the file and folder are marked in blue.
    Sub Macro1A()
    
      Dim InputDate As Variant
      Dim FileType As String
      Dim myFileName As String
      Dim myFolder As String
      
        FileType = ".xlsm"
        myFileName = "Report"
        myFolder = "C:\Chambers-Smith\documents\work"
        
    EnterDate:
          InputDate = InputBox("Please enter date of Report")
          If InputDate = "" Then Exit Sub
        
          If Not IsDate(InputDate) Then
             MsgBox "The date you entered is not valid"
             GoTo EnterDate
          End If
        
          InputDate = " " & Replace(InputDate, "/", "-")
          ThisWorkbook.SaveAs myFolder & "\" & myFileName & InputDate & FileType
          
    End Sub

  5. #5
    Registered User
    Join Date
    12-17-2009
    Location
    Edinburgh
    MS-Off Ver
    Excel 2003
    Posts
    11

    Re: Create Input Box / Save File As

    That is superb! Thanks for your help. Is exactly what I was after.

    Cheers!

+ 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