+ Reply to Thread
Results 1 to 4 of 4

Need to Save File and prompt user for Filename

  1. #1
    Registered User
    Join Date
    01-26-2012
    Location
    Texas
    MS-Off Ver
    Excel 2007
    Posts
    9

    Need to Save File and prompt user for Filename

    Total novice here...

    I have a macro (hooked to a button) that clears the Worksheet once the user is done with data entry. What I'd like to do is have the macro initiate a "save as" routine and use the contents of a cell to name the file prior to running the clear routine. Any help on this would be greatly appreciated. Tom
    Sub SAV()
    '
    ' SAV Macro
    ' Saves File and Clears Worksheet
    '
    ' Keyboard Shortcut: Ctrl+s
    '
    Range("C20").Select
    Selection.ClearContents
    Range("C19").Select
    Selection.ClearContents
    Range("C18").Select
    Selection.ClearContents
    Range("C17").Select
    Selection.ClearContents
    Range("B17").Select
    Selection.ClearContents
    Range("E13").Select
    Selection.ClearContents
    Range("E12").Select
    Selection.ClearContents
    Range("E11").Select
    Selection.ClearContents
    Range("C12").Select
    Selection.ClearContents
    End Sub

  2. #2
    Forum Expert Solus Rankin's Avatar
    Join Date
    05-24-2013
    Location
    Hollywood, CA
    MS-Off Ver
    Win7 Office 2010 VS Express 2012
    Posts
    2,655

    Re: Need to Save File and prompt user for Filename

    Which cell will contain the name?
    Thanks,
    Solus


    Please remember the following:

    1. Use [code] code tags [/code]. It keeps posts clean, easy-to-read, and maintains VBA formatting.
    Highlight the code in your post and press the # button in the toolbar.
    2. Show appreciation to those who have helped you by clicking below their posts.
    3. If you are happy with a solution to your problem, mark the thread as [SOLVED] using the tools at the top.

    "Slow is smooth, smooth is fast."

  3. #3
    Forum Guru HaHoBe's Avatar
    Join Date
    02-19-2005
    Location
    Hamburg, Germany
    MS-Off Ver
    work: 2016 on Win10 (notebook), private: 365 on Win11 (desktop), 2019 on Win11 (notebook)
    Posts
    8,198

    Re: Need to Save File and prompt user for Filename

    Hi, tjamestx,

    Your post does not comply with Rule 3 of our Forum RULES. Use code tags around code.

    Posting code between [CODE]Please [url=https://www.excelforum.com/login.php]Login or Register [/url] to view this content.[/CODE] tags makes your code much easier to read and copy for testing, it also maintains VBA formatting.

    Highlight your code and click the # icon at the top of your post window. More information about these and other tags can be found here



    (This thread should receive no further responses until this moderation request is fulfilled, as per Forum Rule 7)

    Ciao,
    Holger
    Use Code-Tags for showing your code: [code] Your Code here [/code]
    Please mark your question Solved if there has been offered a solution that works fine for you

  4. #4
    Registered User
    Join Date
    01-26-2012
    Location
    Texas
    MS-Off Ver
    Excel 2007
    Posts
    9

    Re: Need to Save File and prompt user for Filename

    Solus and HaHoBe,

    My apologies for the breach in protocol and for leaving critical information out (cell location), stupid mistakes . After a lengthy "trail and error" session, I solved the issue. Thank you for the replies though, I will no doubt be back for more help.

    Thank you, tjamestx

+ 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. Call in Variable File Directory and Filename from Cell into Save As Prompt
    By cyphus64 in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 03-08-2013, 09:37 PM
  2. Replies: 2
    Last Post: 01-16-2013, 03:10 PM
  3. Macro to prompt user for file name and save in location
    By Fungijus in forum Excel Programming / VBA / Macros
    Replies: 8
    Last Post: 11-21-2011, 02:16 PM
  4. Replies: 3
    Last Post: 06-11-2009, 07:08 PM
  5. Save an excel file in vbscript without user prompt
    By mattsmith2@gmail.com in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 01-18-2006, 11:50 AM

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