+ Reply to Thread
Results 1 to 3 of 3

Save As

  1. #1
    Registered User
    Join Date
    12-21-2005
    Posts
    16

    Save As

    Hi
    I have a macro that performs a load of formatting to a workbook. At the end of it i would like to save a copy of it (i.e save as) in a particular folder. The path will always be the same, but i would like the user to enter the actual name that the file will be called.

    Can someone point me in the right direction for the syntex

    Thanks

  2. #2
    Norman Jones
    Guest

    Re: Save As

    Hi Katmando,

    Try:

    '=============>>
    Public Sub Tester()
    Dim WB As Workbook
    Dim sPath As String
    Dim sFilename As String

    Set WB = ActiveWorkbook '<===== CHANGE

    sPath = "C\MyFolder\" '<===== CHANGE

    If Right(sPath, 1) <> "\" Then sPath = sPath & "\"

    sFilename = InputBox("Please type the new file name")

    WB.SaveAs FileName:=sPath & sFilename & ".xls", _
    FileFormat:=xlWorkbookNormal
    End Sub
    '<<=============

    ---
    Regards,
    Norman



    "katmando" <[email protected]> wrote in
    message news:[email protected]...
    >
    > Hi
    > I have a macro that performs a load of formatting to a workbook. At the
    > end of it i would like to save a copy of it (i.e save as) in a
    > particular folder. The path will always be the same, but i would like
    > the user to enter the actual name that the file will be called.
    >
    > Can someone point me in the right direction for the syntex
    >
    > Thanks
    >
    >
    > --
    > katmando
    > ------------------------------------------------------------------------
    > katmando's Profile:
    > http://www.excelforum.com/member.php...o&userid=29803
    > View this thread: http://www.excelforum.com/showthread...hreadid=499331
    >




  3. #3
    Registered User
    Join Date
    12-21-2005
    Posts
    16
    Just what i needed

    Thanks

+ 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