Home |
Search |
Today's Posts |
|
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
I have a file at the end of a macro that needs to be saved as an
employees name and a date to a directory I want to define. I want to use a MsgBox and ask for Name and Date. How do I then convert the entry in the msgbox and join it to my path so the file is saved with the right name and in the right place? |
#2
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Dim nm as string
dim dt as string nm = InputBox("Please Enter your name") dt = InputBox("Please Enter a date" & vbCrLf & "Use format mm-dd-yyyy") If not isdate(format(var1,"mm-dd-yyyy")) Then Msgbox "Invalid Date, exiting macro" Exit Sub End if ActiveWorkbook.SaveAs Filename:=YourStaticPath & nm & dt & ".xls" -- Charles Chickering "A good example is twice the value of good advice." "BillB" wrote: I have a file at the end of a macro that needs to be saved as an employees name and a date to a directory I want to define. I want to use a MsgBox and ask for Name and Date. How do I then convert the entry in the msgbox and join it to my path so the file is saved with the right name and in the right place? |
#3
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Try something like this...
Dim MyValue As String Dim filepath Dim filename MyValue = InputBox("Enter your name", "Name Entry Dialog") fileame = MyValue & "_" & Date Filepath = "c:\whereever\" & filename ThisWorkBook.SaveAs Filename:=Filepath ThisWorkBooK.Close "BillB" wrote: I have a file at the end of a macro that needs to be saved as an employees name and a date to a directory I want to define. I want to use a MsgBox and ask for Name and Date. How do I then convert the entry in the msgbox and join it to my path so the file is saved with the right name and in the right place? |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
http://CannotDeleteFile.net - Cannot Delete File? Try Long Path ToolFilename is too long? Computer Complaining Your Filename Is Too Long? TheLong Path Tool Can Help While most people can go about their businessblissfully unaware of the Windo | Excel Discussion (Misc queries) | |||
showing path and filename | Excel Worksheet Functions | |||
How do i display the Filename without the path? | Excel Discussion (Misc queries) | |||
Pulling in the path to a filename | Excel Worksheet Functions | |||
Filename and path | Excel Programming |