#1   Report Post  
tkaplan
 
Posts: n/a
Default 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   Report Post  
Bob Umlas
 
Posts: n/a
Default

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
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
Help with macro looping and color query function kevinm Excel Discussion (Misc queries) 10 May 26th 05 01:25 AM
Playing a macro from another workbook Jim Excel Discussion (Misc queries) 1 February 23rd 05 10:12 PM
Date macro Hiking Excel Discussion (Misc queries) 9 February 3rd 05 12:40 AM
Help with macro formula and variable Huge project Excel Worksheet Functions 0 December 28th 04 01:27 AM
Macro and If Statement SATB Excel Discussion (Misc queries) 2 December 3rd 04 04:46 PM


All times are GMT +1. The time now is 09:16 PM.

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

About Us

"It's about Microsoft Excel"