+ Reply to Thread
Results 1 to 2 of 2

macro help

  1. #1
    Forum Contributor
    Join Date
    05-04-2005
    Posts
    136

    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.

  2. #2
    Bob Umlas
    Guest

    Re: macro help

    Look at Application.GetSaveAsFileName

    "tkaplan" <[email protected]> wrote in
    message news:[email protected]...
    >
    > 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 to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1