Hello Andy,
I will work on that in the morning. I'm heading off to bed now. Thanks for the input.
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 Starbelow the post.
3. Please mark your post [SOLVED] if it has been answered satisfactorily.
Old Scottish Proverb...
Luathaid gu deanamh maille! (Rushing causes delays!)
That would be great thanks
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
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
That is superb! Thanks for your help. Is exactly what I was after.
Cheers!
There are currently 1 users browsing this thread. (0 members and 1 guests)
Bookmarks