Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default MsgBox for filename and static path

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   Report Post  
Posted to microsoft.public.excel.programming
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?


  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 25
Default MsgBox for filename and static path

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
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
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 Max Loger Excel Discussion (Misc queries) 0 June 14th 11 04:30 PM
showing path and filename Annie Excel Worksheet Functions 1 February 9th 07 01:34 PM
How do i display the Filename without the path? robert_manic Excel Discussion (Misc queries) 3 October 11th 06 05:47 PM
Pulling in the path to a filename Pradhan Excel Worksheet Functions 5 November 8th 05 02:36 AM
Filename and path Mike Excel Programming 1 October 19th 05 07:33 PM


All times are GMT +1. The time now is 10:04 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"