View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
Charles Chickering Charles Chickering is offline
external usenet poster
 
Posts: 272
Default MsgBox for filename and static path

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?