Home |
Search |
Today's Posts |
|
#1
|
|||
|
|||
macro help
I have the following macro written: Sub SaveFile() Dim newFileName As String Dim curMonthName As String Dim curYear As String Dim curCenter As String Dim curCounty As String curMonthName = MonthName(month(Range("C4"))) curYear = Year(Range("C4")) curCenter = Range("E1") curCounty = Range("C1") newFileName = curMonthName & " " & curYear & " " & curCounty & " Billing CT" & curCenter ActiveWorkbook.SaveAs Filename:= _ newFileName, FileFormat:= _ xlNormal, Password:="", WriteResPassword:="", ReadOnlyRecommended:=False _ , CreateBackup:=False End Sub This saves the file with the name that I want it to save as. I would like to add that the user chooses the location of where the file will be saved. right now it's just saving to my documents, but i want the user to be able to change that to where he/she wants. how would i do this? THank you. -- tkaplan ------------------------------------------------------------------------ tkaplan's Profile: http://www.excelforum.com/member.php...o&userid=22987 View this thread: http://www.excelforum.com/showthread...hreadid=387266 |
#2
|
|||
|
|||
Look at Application.GetSaveAsFileName
"tkaplan" wrote in message ... I have the following macro written: Sub SaveFile() Dim newFileName As String Dim curMonthName As String Dim curYear As String Dim curCenter As String Dim curCounty As String curMonthName = MonthName(month(Range("C4"))) curYear = Year(Range("C4")) curCenter = Range("E1") curCounty = Range("C1") newFileName = curMonthName & " " & curYear & " " & curCounty & " Billing CT" & curCenter ActiveWorkbook.SaveAs Filename:= _ newFileName, FileFormat:= _ xlNormal, Password:="", WriteResPassword:="", ReadOnlyRecommended:=False _ , CreateBackup:=False End Sub This saves the file with the name that I want it to save as. I would like to add that the user chooses the location of where the file will be saved. right now it's just saving to my documents, but i want the user to be able to change that to where he/she wants. how would i do this? THank you. -- tkaplan ------------------------------------------------------------------------ tkaplan's Profile: http://www.excelforum.com/member.php...o&userid=22987 View this thread: http://www.excelforum.com/showthread...hreadid=387266 |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Help with macro looping and color query function | Excel Discussion (Misc queries) | |||
Playing a macro from another workbook | Excel Discussion (Misc queries) | |||
Date macro | Excel Discussion (Misc queries) | |||
Help with macro formula and variable | Excel Worksheet Functions | |||
Macro and If Statement | Excel Discussion (Misc queries) |