+ Reply to Thread
Results 1 to 3 of 3

Need to change this macro to save / close instead of allowing user to do so.

  1. #1
    Forum Contributor
    Join Date
    07-02-2012
    Location
    Florida
    MS-Off Ver
    Home -Excel 2007, Work 2016
    Posts
    254

    Need to change this macro to save / close instead of allowing user to do so.

    Currently, this is the process of this macro:
    1 - Shows user what file name is going to be
    2 - Asks user to select the folder in which file should be saved
    3 - On screen is the option for the user to save file in folder they selected
    I need step 3 to be replaced with an automatic file save - close, with the file just saved/closed selected on screen.
    My problem - I am just not seeing how to make the change.
    HELP!!!
    Thanks

    Sub SaveAnyFile()
    MsgBox "Next you will be asked to select the lien folder of the Job Folder to which this invoice pertains. You will not be asked to name the file as that will be automatic so there will be continuity in the file names."
    Dim folder, name As String
    On Error Resume Next
    name = ThisWorkbook.name
    With Application.FileDialog(msoFileDialogFolderPicker)
    .Title = "Please select a folder"
    .AllowMultiSelect = False
    .Show
    folder = .SelectedItems(1)
    End With
    name = ThisWorkbook.name & Application.PathSeparator & Sheet1.Range("c11") & " - " & Sheet1.Range("C13") & " - " & Sheet1.Range("$C18") & ".xlsm"
    ActiveWorkbook.Close
    End Sub

  2. #2
    Forum Expert
    Join Date
    10-06-2008
    Location
    Canada
    MS-Off Ver
    2007 / 2013
    Posts
    5,527

    Re: Need to change this macro to save / close instead of allowing user to do so.

    After 238 posts you still do not remember Forum Rules? #2 must be of interest.

  3. #3
    Forum Expert
    Join Date
    10-06-2008
    Location
    Canada
    MS-Off Ver
    2007 / 2013
    Posts
    5,527

    Re: Need to change this macro to save / close instead of allowing user to do so.

    Re Your PM
    What I am referring to is The forum rules at the top. If you click on the "Forum Rules" tab it'll open up with suggestions and rules we are meant to adhere to.
    Rule #2 that I mentioned in my previous Post ask you to use code tags.

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. macro to change values upon program save/close?
    By jluke94 in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 03-02-2017, 10:59 AM
  2. Macro to turn off save box when user click close button
    By Faridwahidi in forum Excel Programming / VBA / Macros
    Replies: 16
    Last Post: 03-22-2016, 07:43 AM
  3. Replies: 1
    Last Post: 05-15-2013, 01:55 PM
  4. How to lock a cell only not allowing user change format?
    By ohlalayeah in forum Excel General
    Replies: 5
    Last Post: 07-26-2012, 09:24 AM
  5. Save as macro allowing user to overwrite old file
    By jsantos in forum Excel Programming / VBA / Macros
    Replies: 11
    Last Post: 09-12-2011, 08:41 PM
  6. [SOLVED] Allowing the user to specify save location
    By TimN in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 08-16-2006, 12:25 PM
  7. [SOLVED] Allowing User to save file
    By Jordan in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 04-27-2006, 02:30 PM

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