+ Reply to Thread
Results 1 to 18 of 18

Macro to 'save as' in a specific folder

  1. #1
    Forum Contributor
    Join Date
    07-15-2011
    Location
    Whitby, Canada
    MS-Off Ver
    Excel 2010
    Posts
    121

    Macro to 'save as' in a specific folder

    Hi all,

    I have spreadsheets that are completed 2x daily, then a report is run from them (creating another sheet in the spreadsheet). Once this is done, I want to assign a macro to a button to pop up a 'save as' window, prompting them to save it in a folder of my choosing.

    Workbook attached - TIA
    Attached Files Attached Files
    Last edited by Greed; 03-01-2012 at 09:13 AM.

  2. #2
    Valued Forum Contributor
    Join Date
    08-29-2011
    Location
    Mississauga, CANADA
    MS-Off Ver
    Excel 2010
    Posts
    503

    Re: Macro to 'save as' in a specific folder

    Use:

    Please Login or Register  to view this content.
    Regards,
    Khaled Elshaer
    www.BIMcentre.com

    Remember To Do the Following....
    1. Thank those who have helped you by clicking the Star below their post.
    2. Mark your post SOLVED if it has been answered satisfactorily:
    • Select Thread Tools (on top of your 1st post)
    • Select Mark this thread as Solved

  3. #3
    Forum Contributor
    Join Date
    07-15-2011
    Location
    Whitby, Canada
    MS-Off Ver
    Excel 2010
    Posts
    121

    Re: Macro to 'save as' in a specific folder

    Thanks - but I don't see how to specify the folder that I want it to save to... doing this:

    Please Login or Register  to view this content.
    Prompts me to save in the same folder as the original (which is not what I want) with the file name "Unprocessed..."
    Where did I go wrong...? Thanks

  4. #4
    Valued Forum Contributor
    Join Date
    08-29-2011
    Location
    Mississauga, CANADA
    MS-Off Ver
    Excel 2010
    Posts
    503

    Re: Macro to 'save as' in a specific folder

    Please Login or Register  to view this content.

  5. #5
    Valued Forum Contributor smuzoen's Avatar
    Join Date
    10-28-2011
    Location
    Brisbane, Australia
    MS-Off Ver
    Excel 2003/2007/2010
    Posts
    610

    Re: Macro to 'save as' in a specific folder

    I have added a button to your worksheet and attached the following code - this will copy the report into a new workbook which you then can save in directory of your choice and name it what ever you want.
    Please Login or Register  to view this content.
    Attached Files Attached Files
    Hope this helps.
    Anthony
    Pack my box with five dozen liquor jugs
    PS: Remember to mark your questions as Solved once you are satisfied. Please rate the answer(s) by selecting the Star in the lower left next to the Triangle. It is appreciated?

  6. #6
    Forum Contributor
    Join Date
    07-15-2011
    Location
    Whitby, Canada
    MS-Off Ver
    Excel 2010
    Posts
    121

    Re: Macro to 'save as' in a specific folder

    It is still prompting me to save in the folder where the original is located, not the one I am specifying...
    Save As currently prompts the folders where the original is located: "\\whitby\users\ReedG\Desktop\2012 Shift Reports
    I want the pop up to prompt: "Z:\FireOperations\Shift Reports\Unprocessed\"
    Thanks

  7. #7
    Forum Contributor
    Join Date
    07-15-2011
    Location
    Whitby, Canada
    MS-Off Ver
    Excel 2010
    Posts
    121

    Re: Macro to 'save as' in a specific folder

    Thanks Anthony, I still can't specify the folder to save in though...

  8. #8
    Valued Forum Contributor smuzoen's Avatar
    Join Date
    10-28-2011
    Location
    Brisbane, Australia
    MS-Off Ver
    Excel 2003/2007/2010
    Posts
    610

    Re: Macro to 'save as' in a specific folder

    You simply browse to the folder - when the file save dialogue comes up you can select any folder you want. When you hit the save button you can use the Windows explorer box just like you normally would when saving a file in excel. It may default to a directory however you can change the directory to where ever you want. You can also make the filename what ever you want.

  9. #9
    Valued Forum Contributor smuzoen's Avatar
    Join Date
    10-28-2011
    Location
    Brisbane, Australia
    MS-Off Ver
    Excel 2003/2007/2010
    Posts
    610

    Re: Macro to 'save as' in a specific folder

    If you want change the macro to the following - it will default then to "Z:\FireOperations\Shift Reports\Unprocessed\"
    Please Login or Register  to view this content.

  10. #10
    Forum Contributor
    Join Date
    07-15-2011
    Location
    Whitby, Canada
    MS-Off Ver
    Excel 2010
    Posts
    121

    Re: Macro to 'save as' in a specific folder

    I was hoping to avoid that - this is for other useres who aren't very trustworthy when it comes to saving things correctly in the correct place, so I wasnted to take as much of the guesswork out of it as possible...like in this macro I have for a Word document 'save as'

    Please Login or Register  to view this content.

  11. #11
    Valued Forum Contributor smuzoen's Avatar
    Join Date
    10-28-2011
    Location
    Brisbane, Australia
    MS-Off Ver
    Excel 2003/2007/2010
    Posts
    610

    Re: Macro to 'save as' in a specific folder

    See my post just before your last post - I added in a change directory command so it will default to "Z:\FireOperations\Shift Reports\Unprocessed\"

  12. #12
    Forum Contributor
    Join Date
    07-15-2011
    Location
    Whitby, Canada
    MS-Off Ver
    Excel 2010
    Posts
    121

    Re: Macro to 'save as' in a specific folder

    Perfect - yes Anthony! Thanks

  13. #13
    Forum Contributor
    Join Date
    07-15-2011
    Location
    Whitby, Canada
    MS-Off Ver
    Excel 2010
    Posts
    121

    Re: Macro to 'save as' in a specific folder

    Nuts - spoke too soon...I am trying to use this is Excel 2003 (for the other users) and am getting an error here:
    Please Login or Register  to view this content.

  14. #14
    Valued Forum Contributor smuzoen's Avatar
    Join Date
    10-28-2011
    Location
    Brisbane, Australia
    MS-Off Ver
    Excel 2003/2007/2010
    Posts
    610

    Re: Macro to 'save as' in a specific folder

    Change it to
    Please Login or Register  to view this content.

  15. #15
    Forum Contributor
    Join Date
    07-15-2011
    Location
    Whitby, Canada
    MS-Off Ver
    Excel 2010
    Posts
    121

    Re: Macro to 'save as' in a specific folder

    Still getting stuck here:
    Please Login or Register  to view this content.

  16. #16
    Valued Forum Contributor smuzoen's Avatar
    Join Date
    10-28-2011
    Location
    Brisbane, Australia
    MS-Off Ver
    Excel 2003/2007/2010
    Posts
    610

    Re: Macro to 'save as' in a specific folder

    Nuts - spoke too soon...I am trying to use this is Excel 2003
    Sorry - my fault - this will work with Excel 2003 - I have place a button on your workbook and attached the macro - Changed your code so the active page after running the report is A-1 - you can change that back if you want.
    Please Login or Register  to view this content.
    If you want to close the report automatically after saving just add in after the save a Close command.
    Please Login or Register  to view this content.
    Attached Files Attached Files
    Last edited by smuzoen; 02-29-2012 at 06:43 PM.

  17. #17
    Forum Contributor
    Join Date
    07-15-2011
    Location
    Whitby, Canada
    MS-Off Ver
    Excel 2010
    Posts
    121

    Re: Macro to 'save as' in a specific folder

    YES Anthony!! Thanks so much.

  18. #18
    Registered User
    Join Date
    10-08-2009
    Location
    Hull, England
    MS-Off Ver
    Excel 2003, Excel 2007
    Posts
    73

    Re: Macro to 'save as' in a specific folder

    This should sort out the issue, from the old code was still using excel 2007 features, this should rectify the issue, if not keep dropping the number in the line

    Please Login or Register  to view this content.
    Please Login or Register  to view this content.

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

Tags for this Thread

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