+ Reply to Thread
Results 1 to 8 of 8

Prompt for a filename when saving worksheet as csv file.

  1. #1
    Registered User
    Join Date
    03-25-2013
    Location
    Delaware, OH
    MS-Off Ver
    Office 2019/Office 365
    Posts
    65

    Prompt for a filename when saving worksheet as csv file.

    Hello, I am still learning VBA and am currently have my code saving My "VIP" sheet as a csv file in the "P:\Desktop\" location and giving it a specific name. I would like the program to continue to save it to the "P:\Desktop" location but prompt me for a filename. I have my current code below. Thank you for your help.

    Please Login or Register  to view this content.

  2. #2
    Valued Forum Contributor
    Join Date
    07-10-2017
    Location
    Toronto, Ontario
    MS-Off Ver
    Excel 2013
    Posts
    430

    Re: Prompt for a filename when saving worksheet as csv file.

    How about
    Please Login or Register  to view this content.

  3. #3
    Registered User
    Join Date
    03-25-2013
    Location
    Delaware, OH
    MS-Off Ver
    Office 2019/Office 365
    Posts
    65

    Re: Prompt for a filename when saving worksheet as csv file.

    That worked great. Once it is complete I currently get a message box that states the csv file has been saved to the desktop. How can I also get it to show the name of the file saved? do I input "CustomFileName"?

    [code]
    MsgBox ".csv file saved on your desktop."
    [\code]

  4. #4
    Valued Forum Contributor
    Join Date
    07-10-2017
    Location
    Toronto, Ontario
    MS-Off Ver
    Excel 2013
    Posts
    430

    Re: Prompt for a filename when saving worksheet as csv file.

    You could just change that line of code to
    Please Login or Register  to view this content.

  5. #5
    Registered User
    Join Date
    03-25-2013
    Location
    Delaware, OH
    MS-Off Ver
    Office 2019/Office 365
    Posts
    65

    Re: Prompt for a filename when saving worksheet as csv file.

    That did not work, the file name did not appear only .csv file saved on your desktop. Any thoughts? Thanks,

  6. #6
    Valued Forum Contributor
    Join Date
    07-10-2017
    Location
    Toronto, Ontario
    MS-Off Ver
    Excel 2013
    Posts
    430

    Re: Prompt for a filename when saving worksheet as csv file.

    It will only work if
    Please Login or Register  to view this content.
    Is in the same Sub as
    Please Login or Register  to view this content.
    But if this is after you're already done saving, I would recommend using
    Please Login or Register  to view this content.

  7. #7
    Registered User
    Join Date
    03-25-2013
    Location
    Delaware, OH
    MS-Off Ver
    Office 2019/Office 365
    Posts
    65

    Re: Prompt for a filename when saving worksheet as csv file.

    Thank you that worked great. I appreciate your help.

  8. #8
    Valued Forum Contributor
    Join Date
    07-10-2017
    Location
    Toronto, Ontario
    MS-Off Ver
    Excel 2013
    Posts
    430

    Re: Prompt for a filename when saving worksheet as csv file.

    You're welcome

+ 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. Use text from textbox1 as filename when saving the worksheet
    By Nutsy7976 in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 07-12-2018, 09:13 AM
  2. [SOLVED] Need to Save File and prompt user for Filename
    By tjamestx in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 10-04-2013, 11:32 AM
  3. 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
  4. Replies: 3
    Last Post: 06-11-2009, 07:08 PM
  5. [SOLVED] Saving a file to have the filename of the dated it was created
    By Dave in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 05-17-2006, 05:45 AM
  6. [SOLVED] Save as prompt missing saving a .csv file
    By bdw in forum Excel General
    Replies: 1
    Last Post: 05-09-2006, 05:15 PM
  7. Replies: 2
    Last Post: 01-09-2006, 01:00 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