+ Reply to Thread
Results 1 to 9 of 9

"saveas" with cell data as file name?

  1. #1
    Registered User
    Join Date
    05-17-2013
    Location
    United States
    MS-Off Ver
    Excel 2007
    Posts
    6

    Question "saveas" with cell data as file name?

    Hello all, I am fairly new to advanced features and could use some help. I would like to automate the "save as " function with a macro. It would need to use a cell reference (any chosen cell) as the file name and save in a specified location and obviously in the xml format. It would be attached to a form button. Is this possible? I am trying to make a "one" click save and close for my employees who are not at all computer literate (not that I am all that good either).

    Thanks in advance for the help
    Don

  2. #2
    Forum Expert
    Join Date
    08-12-2012
    Location
    Sydney, Australia
    MS-Off Ver
    Excel 2010
    Posts
    5,636

    Re: "saveas" with cell data as file name?

    just double checking.....XML format? or XLSX?

    XML isnt that obvious

  3. #3
    Registered User
    Join Date
    05-17-2013
    Location
    United States
    MS-Off Ver
    Excel 2007
    Posts
    6

    Re: "saveas" with cell data as file name?

    Sorry, the standard format unless it needs to be saved in a macro enabled format.

  4. #4
    Forum Expert JasperD's Avatar
    Join Date
    05-07-2013
    Location
    Netherlands
    MS-Off Ver
    Excel 2016
    Posts
    1,393

    Re: "saveas" with cell data as file name?

    Why do you want to bind it to a button?
    You could do as follows :

    Please Login or Register  to view this content.
    Now if the user presses the 'save' button, it saves and closes the workbook with the name in A1 and to the path you set in the macro.
    Same happens if the user presses the 'close' button ; it saves and closes the workbook.
    They won't get popups asking for savenames and if they should overwrite etc.
    Easiest way, no?

    Please press the * below if this helps.

  5. #5
    Registered User
    Join Date
    05-17-2013
    Location
    United States
    MS-Off Ver
    Excel 2007
    Posts
    6

    Re: "saveas" with cell data as file name?

    Thank you Jasper. I'll give that a try.

    Don

  6. #6
    Registered User
    Join Date
    05-17-2013
    Location
    United States
    MS-Off Ver
    Excel 2007
    Posts
    6

    Re: "saveas" with cell data as file name?

    Hello Jasper. I must be doing something wrong. I have a excel macro enabled template that I am using. Trying to automate the saveas function. I want to save to a folder C:\Shift Summary. I am trying to reference cell A32 as the saved file name. I tried to use the code you sent. I created a module in VB and copy and pasted. when i look in the workbook, there is no Macro assigned to it and when I close using the "X" it ask if I want to save changes. I chose yes and it closes but not where I want and Not with the new file name. It also leaves the data in the template instead of giving me a clean template after close. Am I doing something wrong?

    Thanks again

    Don

  7. #7
    Forum Expert
    Join Date
    08-12-2012
    Location
    Sydney, Australia
    MS-Off Ver
    Excel 2010
    Posts
    5,636

    Re: "saveas" with cell data as file name?

    this code needs to be placed in "THISWORKBOOK" and not module in your spreadsheet

    Please Login or Register  to view this content.
    Last edited by humdingaling; 05-23-2013 at 02:25 AM. Reason: Put new loop if filename exist

  8. #8
    Registered User
    Join Date
    05-17-2013
    Location
    United States
    MS-Off Ver
    Excel 2007
    Posts
    6

    Re: "saveas" with cell data as file name?

    Worked great, TY so much

  9. #9
    Forum Contributor arlu1201's Avatar
    Join Date
    09-09-2011
    Location
    Bangalore, India
    MS-Off Ver
    Excel 2003 & 2007
    Posts
    19,166

    Re: "saveas" with cell data as file name?

    Eoluke,

    Based on your last post in this thread, its apparent that you are satisfied with the solution(s) you've received and have solved your question, but you haven't marked your thread as "SOLVED". I will do it for you this time.

    In future, to mark your thread as Solved, you can do the following -
    Select Thread Tools-> Mark thread as Solved.

    Incase your issue is not solved, you can undo it as follows -
    Select Thread Tools-> Mark thread as Unsolved.

    Also, since you are relatively new to the forum, i would like to inform you that you can thank those who have helped you by clicking the small star icon located in the lower left corner of the post which helped you. This adds to the reputation of the person who has taken the time to help you.
    If I have helped, Don't forget to add to my reputation (click on the star below the post)
    Don't forget to mark threads as "Solved" (Thread Tools->Mark thread as Solved)
    Use code tags when posting your VBA code: [code] Your code here [/code]

+ 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