+ Reply to Thread
Results 1 to 3 of 3

Save one worksheet as a .CSV file w/ Macro

  1. #1
    Registered User
    Join Date
    01-07-2010
    Location
    Oregon
    MS-Off Ver
    Excel 2007, 2010 - maintain backwards compatibility to 2003 when possible
    Posts
    17

    Talking Save one worksheet as a .CSV file w/ Macro

    So I am trying to design a workbook that has two worksheets... one with instructions and a button for users to click to "Save as .CSV File", another for the data that will go into that CSV file.

    Here are the Macro requirements:
    1. The user will be prompted for the File & Location to save the .CSV file
    2. If they click 'Cancel', no changes will be made (and unlike my current code, it won't ask them to debug).
    3. Confirmation of the filename is not necessary even though it's currently included in my Macro
    4. The file will automatically "reopen" so that they only see the new .CSV file without the original Instruction tab.

    Here's what I've got so far. Any help would be greatly appreciated! =)

    Please Login or Register  to view this content.
    Last edited by vaximily; 01-07-2010 at 06:57 PM.

  2. #2
    Forum Expert davegugg's Avatar
    Join Date
    12-18-2008
    Location
    WI, US
    MS-Off Ver
    2010
    Posts
    1,884

    Re: Save one worksheet as a .CSV file w/ Macro

    Your code looks pretty solid. I'd just cut it down a bit like so:

    Please Login or Register  to view this content.
    Is your code running too slowly?
    Does your workbook or database have a bunch of duplicate pieces of data?
    Have a look at this article to learn the best ways to set up your projects.
    It will save both time and effort in the long run!


    Dave

  3. #3
    Registered User
    Join Date
    01-07-2010
    Location
    Oregon
    MS-Off Ver
    Excel 2007, 2010 - maintain backwards compatibility to 2003 when possible
    Posts
    17

    Talking Re: Save one worksheet as a .CSV file w/ Macro

    Perfect!

    That's exactly what I needed, and it fixes both the issues I was having.

    I'd seen code similar to this elsewhere but couldn't wrap my brain around the "Sheets("Manual_Template").Copy" part in the context they were using... now it makes perfect sense.

+ 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