+ Reply to Thread
Results 1 to 6 of 6

Export worksheet as CSV with Save As dialog

  1. #1
    Registered User
    Join Date
    04-28-2014
    Location
    Greece
    MS-Off Ver
    Excel 2010
    Posts
    3

    Question Export worksheet as CSV with Save As dialog

    Hi,

    I have the following issue. I want to export a specific worksheet in CSV format but I want the macro to open a Save As dialog.
    Actually I have found a macro that exports the sheet in PDF format and it works great. Can someone adjust the following macro in order to export also in CSV format? I want to copy the whole worksheet and paste only values in the new CSV, not formulas.
    The idea is to give the user the option to export in either CSV or PDF format, using 2 different macros.
    Thanks!

    ps: I don't know

    Please Login or Register  to view this content.
    Last edited by panblock; 04-29-2014 at 12:06 PM.

  2. #2
    Forum Contributor Jack7774's Avatar
    Join Date
    08-31-2012
    Location
    Georgia, US
    MS-Off Ver
    Excel 2010
    Posts
    576

    Re: Export worksheet as CSV with Save As dialog

    Try this. I didn't change much except to give you the option of which format to save it as and added the option for CSV.

    Please Login or Register  to view this content.
    Thank those who have helped you by clicking the Star * below their name and please mark your post [SOLVED] if it has been answered satisfactorily.

  3. #3
    Registered User
    Join Date
    04-28-2014
    Location
    Greece
    MS-Off Ver
    Excel 2010
    Posts
    3

    Re: Export worksheet as CSV with Save As dialog

    Hi Jessebranum777, thank you for your reply!

    1. If the export file is CSV, the code seems to run but I cannot save the file. I tried different locations but the file is not saved anyway. The code works great if it is a PDF

    2. I really like your idea with "Yes" or "No" but is it possible to make a new macro since the pdf and the csv are exported from different sheets? I use sheet "(3) Google Calendar Setup" to get the data for pdf and "(4) Google Calendar input" for CSV. I guess it would be too complicated to adjust the macro the export pdf from sheet (3) or export csv from sheet (4).

    The actual file is this. It is a Marathon training program. The sheet that I want to extract in CSV format is the last (4) and it is an import sheet for Google Calendar.

    https://drive.google.com/file/d/0B5A...it?usp=sharing
    Last edited by panblock; 04-29-2014 at 05:04 AM.

  4. #4
    Forum Contributor Jack7774's Avatar
    Join Date
    08-31-2012
    Location
    Georgia, US
    MS-Off Ver
    Excel 2010
    Posts
    576

    Re: Export worksheet as CSV with Save As dialog

    I am not sure why the code for applicationsaveas didn't work for CSV so I added a slight modification for that section. I also changed it up so that there is no option for yes or no anymore but instead it will save in the appropriate formate based on which sheet name you are on as you mentioned they are exported from different sheets. No it was not complicated at all. Try this.

    Please Login or Register  to view this content.

  5. #5
    Registered User
    Join Date
    04-28-2014
    Location
    Greece
    MS-Off Ver
    Excel 2010
    Posts
    3

    Re: Export worksheet as CSV with Save As dialog

    Works great!
    Thank you very much for your time and help!

  6. #6
    Forum Contributor Jack7774's Avatar
    Join Date
    08-31-2012
    Location
    Georgia, US
    MS-Off Ver
    Excel 2010
    Posts
    576

    Re: Export worksheet as CSV with Save As dialog [SOLVED]

    No problem. Don't forget to add rep * next to my name please. I am glad it works for you.

+ 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. VBA Export worksheet to CSV and save on desktop
    By jph89 in forum Excel General
    Replies: 0
    Last Post: 08-30-2012, 11:55 AM
  2. Export word file prompting a dialog box save location
    By Fossilized in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 04-05-2011, 03:04 AM
  3. export and save worksheet as a picture.
    By Diesel13 in forum Excel General
    Replies: 18
    Last Post: 10-22-2010, 05:04 PM
  4. Save\export specific worksheet error
    By SarahPintal in forum Excel Programming / VBA / Macros
    Replies: 10
    Last Post: 01-23-2010, 05:12 PM
  5. Export with save as dialog
    By tommy_gtr in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 11-22-2005, 11:22 AM

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